| excaliber7388 |
10-23-2005 08:29 PM |
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;
}
|