Error 103 / Q.
#6

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
if (strcmp("/pay", cmdtext, true) == 0) {
new tmp[256], tmp2[256];

I can also tell you you'll never need a string size of 256 I'm guessing those are for messages.
More errors,14.
The whole code:
pawn Код:
if (strcmp("/pay", cmdtext, true) == 0) {
    new tmp[256], tmp2[256];
    tmp = strtok(cmdtext, idx);
    tmp2 = strtok(cmdtext, idx);

    if (!strlen(tmp)} {
         SendClientMessage (playerid, COLOR_YELLOW, "Comanda este /pay [playerid] [suma]" ! );
         return 1;
    }
   
    if (!strlen(tmp2)} {
         SendClientMessage (playerid, COLOR_YELLOW, "Comanda este /pay [playerid] [suma]" ! );
         return 1;
    }
   
    new receiver, money;
    receiver = strval(tmp);
    money = strval(tmp2);
   
    if(GetPlayerMoney(playerid) < money){
       SendClientMessage(playerid COLOR_YELLOW, "Nu ai destui bani ! " );
       return 1;
 }

    new string[128];
    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    new playername2[MAX_PLAYER_NAME];
    GetPlayerName(receiver, playername2, sizeof(playername2));
    format(string, sizeof(string), "Ai primit $%d de la %s ",money,playername);
    SendClientMessage (playerid, COLOR_YELLOW, string);
    format(string, sizeof(string), "I-ai dat $%d lui %s ",money,playername2);
    SendClientMessage (playerid, COLOR_YELLOW, string);

    GivePlayerMoney(playerid, (0 - money));
    GivePlayerMoney(receiver, money);
   
    return 1;
}
Reply


Messages In This Thread
Error 103 / Q. - by Badarau - 23.05.2013, 14:42
Re: Error 103 / Q. - by SuperViper - 23.05.2013, 14:44
Re: Error 103 / Q. - by dannyk0ed - 23.05.2013, 14:44
Re: Error 103 / Q. - by Badarau - 23.05.2013, 14:53
Re: Error 103 / Q. - by Pottus - 23.05.2013, 14:55
Re: Error 103 / Q. - by Badarau - 23.05.2013, 15:00
Re: Error 103 / Q. - by Badarau - 23.05.2013, 16:18
Re: Error 103 / Q. - by Badarau - 24.05.2013, 03:00

Forum Jump:


Users browsing this thread: 1 Guest(s)