Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-04-2007, 01:15 AM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
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.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #2  
Old 02-04-2007, 09:00 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Use params inside the player.attr.
HTML Code:
If (params[0] == player.account)
{
  //stuff
}
Reply With Quote
  #3  
Old 02-04-2007, 06:21 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
How do i actually set the params in player.attr?
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #4  
Old 02-04-2007, 09:26 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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[])
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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