Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Gani script question (https://forums.graalonline.com/forums/showthread.php?t=71930)

JkWhoSaysNi 02-04-2007 01:15 AM

Gani script question
 
Hello,

I'm using player.attr to attach a scripted gani to players.

In the gani the player object refers to the player to which the gani belongs. This is fine, but how can I access the player of the person viewing the gani?

For example, the gani shows an image but i dont want the person to see the image attached to themselves.

I want to do something like:
PHP Code:

showimg(200,.....);
if (
client.player == player) {
findimg(200).alpha 0;


Where client.player is the reference to the player viewing the gani rather than the player who has the gani set in player.attr.

Chandler 02-04-2007 09:00 AM

Use params inside the player.attr.
HTML Code:

If (params[0] == player.account)
{
  //stuff
}


JkWhoSaysNi 02-04-2007 06:21 PM

How do i actually set the params in player.attr?

Admins 02-04-2007 09:26 PM

Simpliest solution would be to set some global variable to the player or player account, e.g. in the System-Weapon you do "localplayer = player;". The gani script can access all variables, so you just would need to check "if (player==localplayer)...". The "player" variable in gani script is the object to which the gani belongs, it can be the local player, other players, or even npcs or projectiles.

Another way (more complex) would be to set player.attr[1] to the gani script, and e.g. use player.attr[2] to the account name of the player, but that would be redundant and better be solved by the first way I have described. You can also pass parameters directly to the gani script without using another attr[], you would need to do something like "player.attr[1] = "myani.gani,1,2,3";" and in the gani script you get the parameters in onPlayerEnters(param1,param2,param2), I have not tested that a lot though (it works definitely if you use if (playerenters) and check for params[])


All times are GMT +2. The time now is 01:24 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.