Help with /pay command
#1

Hello i created this command so other players can give money to eachother.


new idx;
new cmd[256];

cmd = strtok(cmdtext, 1dx);

if(strcmp(cmd, "/money", true) == 0) {
return 1;
}

if(strcmp(cmd, "/pay", true) == 0) {
new tmp[256], temp2[256];
tmp = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);

if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_YELLOW, "Usage: /pay [ID] [amount]");
return 1;
}

if(!strlen(tmp2)) {
SendClientMessage(playerid, COLOR_YELLOW, "Usage: /pay [ID] [amount]");
return 1;
}

new receiver, money;
receive = strval(tmp);
money = strval(tmp2)

if(GetPlayerMoney(playerid, < money){
SendClientMessage(playerid, COLOR_YELLOW, "The amount you typed in is higher than the amount of cash you have.");
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), "You receive $%d from %s.", money, playername);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "You give $%d to %s.", money, playername2);
SendClientMessage(playerid, COLOR_YELLOW, string);

GivePlayerMoney(playerid, (o - money));
GivePlayerMoney(receiver, money);

return 1;
}




When i compile it, it says:

C:\Users\Chrille\Desktop\gta Sa-mp\gamemodes\new.pwn(70 : error 017: undefined symbol "strtok"
C:\Users\Chrille\Desktop\gta Sa-mp\gamemodes\new.pwn(70 : error 017: undefined symbol "dx"
C:\Users\Chrille\Desktop\gta Sa-mp\gamemodes\new.pwn(70 : error 029: invalid expression, assumed zero
C:\Users\Chrille\Desktop\gta Sa-mp\gamemodes\new.pwn(70 : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply


Messages In This Thread
Help with /pay command - by magent - 30.12.2012, 12:37
Re: Help with /pay command - by Feastahashi - 30.12.2012, 12:46
Re: Help with /pay command - by magent - 30.12.2012, 12:52
Re: Help with /pay command - by magent - 30.12.2012, 12:56
Re: Help with /pay command - by Vinninho - 30.12.2012, 13:24
Re: Help with /pay command - by magent - 30.12.2012, 13:28
Re: Help with /pay command - by Vinninho - 30.12.2012, 13:29
Re: Help with /pay command - by magent - 30.12.2012, 13:31
Re: Help with /pay command - by magent - 30.12.2012, 13:36
Re: Help with /pay command - by Feastahashi - 30.12.2012, 13:37

Forum Jump:


Users browsing this thread: 1 Guest(s)