Hab hier diesen Command(In GF heißt der /pay)
if(strcmp(cmd, "/gib", true) == 0) {
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "Benutzung: /gib [Spieler-ID] [Geldbetrag]");
return 1;
}
giveplayerid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "Benutzung: /gib [Spieler-ID] [Geldbetrag]");
return 1;
}
moneys = strval(tmp);
//printf("givecash_command: %d %d",giveplayerid,moneys);
if (IsPlayerConnected(giveplayerid)) {
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = GetPlayerMoney(playerid);
if (moneys > 0 && playermoney >= moneys) {
GivePlayerMoney(playerid, (0 - moneys));
GivePlayerMoney(giveplayerid, moneys);
format(string, sizeof(string), "Du hast %s(player: %d) $%d gegeben.", giveplayer,giveplayerid, moneys);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "Du hast $%d von %s(ID: %d) bekommen.", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
printf("%s(ID:%d) hat %d an %s(ID:%d) gegeben.",sendername, playerid, moneys, giveplayer, giveplayerid);
}
else {
SendClientMessage(playerid, COLOR_YELLOW, "Ungültige Transaktionssumme");
}
}
else {
format(string, sizeof(string), "Das ist kein aktiver Spieler", giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
return 1;
}
Diese Fehlermeldung kommt:
C:\Users\Kevin\Desktop\away\Grand Theft Auto San Andreas Snow-MP + script\SA-MP 0.3a\gamemodes\AG-Reallife.pwn(2550) : warning 219: local variable "tmp" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Warning.