Code:
// givemoney
if(response.size > 9 && getsubstr(response, 0, 9) == "givemoney")
{
s = getsubstr(response, 10);
tok = strtok(s, "|");
id = int(tok[0]);
num = int(tok[1]);
if(num <= 0) // we don't want ppl stealing money
continue;
players = getentarray("player", "classname");
for(i = 0;i < players.size;i++)
{
if(players[i] != self && players[i] getentitynumber() == id)
{
players[i].money += num;
self.money -= num;
players[i] iprintlnbold(num + " money from " + self.name);
}
}
}
I really dont understand how you think i need precache.
I finded this.
Code:
default:
str = strtok(response,"|");
if(str.size==3)
{
if(str[0]=="give")
{
id=int(str[1]);
num=int(str[2]);
players=getentarray("player","classname");
if(self.pers["money"]>=num && num>0 && isplayer(players[id]) && players[id]!=self)
{
players[id] ER_zumbis\_ER::givemoney(num);
self ER_zumbis\_ER::givemoney(num*-1);
printstr("gotmoney",players[id],self.name);
}
else if(num<0)
self iprintlnbold(&"ER_STOLEN_MONEY");
}
}
break;