Quote:
Originally Posted by Shabi RoxX
you have allready define tmp ans tmp2 i thing
|
Nope this is the full line in an empty pawn script.
pawn Код:
if (strcmp("/send", cmdtext, true, 5) == 0)
new tmp[256], tmp2[256];
tmp - strtok(cmdtext, idx);
tmp2 - strtok(cmdtext, idx);
if (!strlen(tmp)) {
SendClientMessage(playerid, 0x666666FF, "Usage: /send [ID] [ammount]");
return 1;
}
if (!strlen(tmp2)) {
SendClientMessage(playerid, 0x666666FF, "Usage: /send [ID] [ammount]");
return 1;
}
new receiver, money;
receiver = strval(tmp);
money = strval(tmp2);
if (GetPlayerMoney(playerid) < money) {
SendClientMessage(playerid, 0xFFFFFFFF, "The ammount you typed in is higher than you have."
return 1;
}
new string[126];
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 received $%d from %s", money, playername);
SendClientMessage(playerid, 0x666666FF, string);
format(string, sizeof(string), "You gave $%d to %s", money, playername2);
SendClientMessage(playerid, 0x666666FF, string));
GivePlayerMoney(0 - money));
GivePlayerMoney(receiver, money);
return 1;
}