hey,
Da ich noch nicht soweit bin, so nen CMD selbst zu machen, hab ich ihn aus dem LVDM Gamemode genommen.
Leider krieg ich immer folgende Errors:
I:\0.2X Server\gamemodes\OwnGM.pwn(1829) : error 017: undefined symbol "strtok"
I:\0.2X Server\gamemodes\OwnGM.pwn(1829) : error 033: array must be indexed (variable "tmp")
I:\0.2X Server\gamemodes\OwnGM.pwn(1835) : error 017: undefined symbol "giveplayerid"
I:\0.2X Server\gamemodes\OwnGM.pwn(1837) : error 017: undefined symbol "strtok"
I:\0.2X Server\gamemodes\OwnGM.pwn(1837) : error 033: array must be indexed (variable "tmp")
I:\0.2X Server\gamemodes\OwnGM.pwn(1842) : error 017: undefined symbol "moneys"
I:\0.2X Server\gamemodes\OwnGM.pwn(1844) : error 017: undefined symbol "giveplayerid"
I:\0.2X Server\gamemodes\OwnGM.pwn(1845) : error 017: undefined symbol "giveplayerid"
I:\0.2X Server\gamemodes\OwnGM.pwn(1845) : error 017: undefined symbol "giveplayer"
I:\0.2X Server\gamemodes\OwnGM.pwn(1845) : error 029: invalid expression, assumed zero
I:\0.2X Server\gamemodes\OwnGM.pwn(1845) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
11 Errors.
Alles anzeigen
CMD:
if(strcmp(cmdtext, "/givecash", true) == 0)
{
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, FEHLERFARBE, "Benutzung: /givecash [playerid] [amount]");
return 1;
}
giveplayerid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, FEHLERFARBE, "Benutzung: /givecash [playerid] [amount]");
return 1;
}
moneys = strval(tmp);
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), "You have sent %s(player: %d), $%d.", giveplayer,giveplayerid, moneys);
SendClientMessage(playerid, INFOTEXT, string);
format(string, sizeof(string), "You have recieved $%d from %s(player: %d).", moneys, sendername, playerid);
SendClientMessage(giveplayerid, INFOTEXT, string);
printf("%s(playerid:%d) has transfered %d to %s(playerid:%d)",sendername, playerid, moneys, giveplayer, giveplayerid);
}
else {
SendClientMessage(playerid, INFOTEXT, "Invalid transaction amount.");
}
}
else {
format(string, sizeof(string), "%d is not an active player.", giveplayerid);
SendClientMessage(playerid, IINFOTEXT, string);
}
return 1;
}
Ich hoffe mir kann dabei jemand helfen.
mfg Kaiza