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 10-23-2005, 08:29 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Event coins

Here's what I have so far for an event coin script. The only problem is, instead of adding the event coins to another player, it adds it to your own couunt! whats wrong? (this is a two part script, the first part is the part that makes the event coin, the second is the part for the player to recieve it)
NPC Code:

if(actionserverside){
if(strequals(#p(0),EC)){
with(getplayer(#p(2))){
setstring clientr.eventcoin,#v(strtofloat(#s(clientr.eventco in))+1);
setstring server.eventprize,#v(strtofloat(#p(3)));
savelog2 StaffToollog.txt,Staff="#p(1)" Added Eventcoins To Player="#p(2)"
Ammount="#p(3);
}
}
}
//#CLIENTSIDE
if(playerchats){
if(strequals(#t(0),/addeventcoin)){
triggeraction 0,0,serverside,Events Team/Coin system,EC,#a,#t(1),#t(2);
triggeraction 0,0,serverside,-eventcoinsystem,ECup;
}
}

if(weaponfired){
say2 say /addeventcoin "account"#b
to give that player an #b
event coin. #b
Do not abuse this, it is watched.;
}


now the part for the player:
NPC Code:

if(actionserverside){
if(strequals(#p(0),ECup)){
setstring clientr.eventcoin,#v(strtofloat(#s(clientr.eventco in))+1);
triggeraction 0,0,clientside,-eventcoinsystem,text;
}
}

//#CLIENTSIDE
if(actionclientside){
if(strequals(#p(0),text)){
setplayerprop #c,Got an event coin!;
}
}

if(created || timeout){
showimg 3111217,dr-eventcoin.png,15,130;
changeimgvis 3111217,5;
showtext 3111218,28,135,Arial,b,#s(clientr.eventcoin);
changeimgvis 3111218,6;
changeimgcolors 3111218,0,0,0,1;
changeimgzoom 3111218,.8;
timeout=.05;
}

Reply With Quote
  #2  
Old 10-23-2005, 08:45 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Because when you trigger -eventcoinsystem serverside, it's still doing it for the player activating it.
Also, is it just me or does this script seem really redundant? Wth is server.eventprize string for? According to syntax, it doesnt get set to anything.
__________________
Reply With Quote
  #3  
Old 10-23-2005, 11:05 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
no, I changed this a lot, origionally it would boost the event coins by the said ammount, but then I realized that this could be abused, so I changed it to only one per event won. And how do I cange it so it happens to the other player, not the events team member doing it.
Reply With Quote
  #4  
Old 10-23-2005, 11:55 PM
Maniaman Maniaman is offline
Registered User
Join Date: Aug 2005
Posts: 326
Maniaman is on a distinguished road
Quote:
Originally Posted by ZeLpH_MyStiK
Because when you trigger -eventcoinsystem serverside, it's still doing it for the player activating it.
Also, what you are doing could easily be done in 1 script.
__________________

Current Maloria Event: (click to go to it)
Reply With Quote
  #5  
Old 10-24-2005, 01:19 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
true, but the second script is for displaying the event coins in the corner. And wouldn't it still do it for the player activating it if it were clientside?
Reply With Quote
  #6  
Old 10-24-2005, 09:58 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
gah, this ugly code makes me love gscript2 soo much more. I'd just do players[index].clientr.blah++; Don't you just love it? I actually never learned that in gscript1. GScript1 is just too damn confusing. GScript2 improves Massokre as a scripter.
Reply With Quote
  #7  
Old 10-24-2005, 12:49 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
  • Player's chat can be set serverside - no actionclientside needed
  • Do you really need to redraw the event coin count every 0.05 seconds?
  • As Maniaman said, this could be easier done in one script, and just using a check of some description to filter out staff from players
__________________
Skyld
Reply With Quote
  #8  
Old 10-24-2005, 09:34 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Still gives the event coin to the person who says it x_X
Reply With Quote
  #9  
Old 10-24-2005, 09:42 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by excaliber7388
Still gives the event coin to the person who says it x_X
I do wish you would stop dismissing problems.
__________________
Skyld
Reply With Quote
  #10  
Old 10-24-2005, 09:52 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Oh wow, I got it NVM duh, sorry guys X_X this was a dumb one lol

Last edited by excaliber7388; 10-24-2005 at 10:22 PM..
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:31 AM.


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