Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-12-2011, 12:06 AM
Trakan Trakan is offline
It's all about cats!
Trakan's Avatar
Join Date: Sep 2010
Location: France
Posts: 64
Trakan is an unknown quantity at this point
Change player var with player chat

Ok i make a Humor script (viewable at profile rights click).

Here is my script :
PHP Code:
// Scripted by *Trakan (Admin)
//#CLIENTSIDE
function onWeaponFired() {
say2("For change humor say #b /humor <your humor>");
}

function 
onPlayerChats(){ 
if(
player.chat.starts("/humor")){
[
U]triggerserver("gui"name"tagOn"clientr.humor);[/U]
player.chat "Humor changed !";
 } 

My problem is :
i need to set se variable clientr.humor with the player.chat

exemple :
the player say /humor test
The variable changed to test.

Thanks for future help.
Reply With Quote
  #2  
Old 02-12-2011, 12:12 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
There's no reason to use a clientr variable here since it looks like you're not doing any validating:

PHP Code:
//#CLIENTSIDE 
function onWeaponFired() { 
say2("For change humor say #b /humor <your humor>"); 


function 
onPlayerChats(){  
  if (
player.chat.starts("/humor ")){ 
    
player.client.humor player.chat.substring(7);
    
player.chat "Humor changed!"
  }

__________________
Reply With Quote
  #3  
Old 02-12-2011, 08:08 AM
Trakan Trakan is offline
It's all about cats!
Trakan's Avatar
Join Date: Sep 2010
Location: France
Posts: 64
Trakan is an unknown quantity at this point
Thanks but what the difference between client. & clientr. ?
Reply With Quote
  #4  
Old 02-12-2011, 08:30 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Trakan View Post
Thanks but what the difference between client. & clientr. ?
clientr - read-only to the client-side, you can change the value temporarily on the client-side but it won't be reflected on the serverside.

client - read and writable on the client-side and changes made will be reflected on the serverside as well.
__________________
Quote:
Reply With Quote
  #5  
Old 02-12-2011, 08:44 AM
Trakan Trakan is offline
It's all about cats!
Trakan's Avatar
Join Date: Sep 2010
Location: France
Posts: 64
Trakan is an unknown quantity at this point
Thanks
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 08:04 PM.


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