Help please
#1

Hey guys, Whats wrong with my /pay commanD?
pawn Код:
if (strcmp(cmd, "/pay", true) == 0)
    {

        new giveplayerid = strval(tmp);
      tmp = strtok(cmdtext, idx);
        giveplayerid = strval(tmp);
        new cashamount = strval(tmp2);
        if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /pay [playerid] [amount]");
        if(!strlen(tmp2)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /pay [playerid] [amount]");
        if(GetPlayerMoney(playerid) < cashamount) SendClientMessage(playerid, COLOR_RED, "Not enough money");
        {
       
        GivePlayerMoney(giveplayerid,cashamount);
        GivePlayerMoney(playerid,-cashamount);
        GetPlayerName(giveplayerid,playername,sizeof(playername));
        format(string,sizeof(string),"You sended %s %d money",playername,cashamount);
        SendClientMessage(playerid,COLOR_YELLOW,string);
       
        GetPlayerName(playerid,playername,sizeof(playername));
        format(string,sizeof(string),"%s has given you %d money.",playername,cashamount);
        SendClientMessage(giveplayerid,COLOR_YELLOW,string);

        }
        return 1;
 }
I also want that you can't give yourself money :P
I thought it was like:
if(ID == playerid) return SendClientMessage(giveplayerid,COLOR_YELLOW,"You can't give yourself money!");

Thanks
Reply


Messages In This Thread
Help please - by bartje01 - 15.07.2010, 21:13
Re: Help please - by Vince - 15.07.2010, 21:30
Re: Help please - by bartje01 - 15.07.2010, 21:34
Re: Help please - by oliverrud - 15.07.2010, 21:36
Re: Help please - by bartje01 - 15.07.2010, 21:40
Re: Help please - by oliverrud - 15.07.2010, 21:43
Re: Help please - by bartje01 - 15.07.2010, 21:45
Re: Help please - by oliverrud - 15.07.2010, 21:46
Re: Help please - by Joe_ - 15.07.2010, 21:46
Re: Help please - by bartje01 - 15.07.2010, 21:54

Forum Jump:


Users browsing this thread: 3 Guest(s)