01.07.2011, 03:11
I get errors on Returnuser when I compile I am using it only in /pay yet.
Command:
I got Returnuser here too near OnPlayerCommandText:
Errors:
How can I fix this?
Command:
Code:
if(strcmp(cmd, "/pay", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /pay [playerid/PartOfName] [amount]"); return 1; } //giveplayerid = strval(tmp); giveplayerid = ReturnUser(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /pay [playerid/PartOfName] [amount]"); return 1; } moneys = strval(tmp); if(moneys < 1 || moneys > 99999) { SendClientMessage(playerid, COLOR_GRAD1, "Dont go below 1, or above 99999 at once."); return 1; } if (IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { if (ProxDetectorS(5.0, playerid, giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); playermoney = GetPlayerMoney(playerid); if (moneys > 0 && playermoney >= moneys) { ConsumingMoney[giveplayerid] = 1; GivePlayerMoney(playerid, (0 - moneys)); GivePlayerMoney(giveplayerid, moneys); format(string, sizeof(string), " You have sent %s(player: %d), $%d.", giveplayer,giveplayerid, moneys); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); SendClientMessage(playerid, COLOR_GRAD1, string); format(string, sizeof(string), " You have recieved $%d from %s(player: %d).", moneys, sendername, playerid); SendClientMessage(giveplayerid, COLOR_GRAD1, string); format(string, sizeof(string), "%s has paid $%d to %s", sendername, moneys, giveplayer); PayLog(string); if(moneys >= 1000000) { ABroadCast(COLOR_YELLOW,string,1); } PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0); format(string, sizeof(string), "* %s takes out some cash, and hands it to %s.", sendername ,giveplayer); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } else { SendClientMessage(playerid, COLOR_GRAD1, " Invalid transaction amount."); } } else { SendClientMessage(playerid, COLOR_GRAD1, " Your too far away."); } }//invalid id } else { format(string, sizeof(string), " %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_GRAD1, string); } } return 1; }
Code:
new tmp[256]; new idx; new cmd[256]; cmd = strtok(cmdtext, idx); //new playername[MAX_PLAYER_NAME]; new string[256]; //new name[MAX_PLAYER_NAME]; new sendername[MAX_PLAYER_NAME]; new otherplayer; otherplayer = ReturnUser(tmp); new giveplayer[MAX_PLAYER_NAME];
Errors:
Code:
C:\Users\user\Desktop\TeamDeathMatch v1.0 SA-MP 0.3c\FortCarson Deathmatch SA-MP 0.3c\gamemodes\[GM]DMFORTCARSON.pwn(458) : error 017: undefined symbol "ReturnUser" C:\Users\user\Desktop\TeamDeathMatch v1.0 SA-MP 0.3c\FortCarson Deathmatch SA-MP 0.3c\gamemodes\[GM]DMFORTCARSON.pwn(1171) : error 017: undefined symbol "ReturnUser" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.