Results 1 to 10 of 12

Thread: givemoney

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by Rocky View Post
    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;
    I finded this
    Good for you! So what? Why mention it? If it is giving you errors, please state the nature of the medical emergency.

  2. The Following User Says Thank You to Tally For This Useful Post:

    IzNoGoD (19th January 2014)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •