[Solved] Symbol already defined. THANKS FOR HELP!
#1

Hey, there is an error. Symbol already defined.
pawn Код:
if(strcmp(cmd, "/money", true) == 0) {
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /money [playerid]");
new giveplayerid = ReturnUser(tmp);
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,red, "Invalid Player ID.");
{
new string[128];
new giveplayername[24];
GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
format(string,sizeof(string),"Money of %s.",giveplayername);
SendClientMessage(playerid,red,string);
format(string, sizeof(string), "$%d", GetPlayerMoney(giveplayerid));
SendClientMessage(playerid,COLOR_WHITE,string);
}
return 1;
}
The error:
Код:
error 021: symbol already defined: "giveplayerid"
The error is in:
pawn Код:
new giveplayerid = ReturnUser(tmp);
WTF??

Can someone help? Because I don't get it :/
Reply
#2

This means giveplayerid is already defined.

Do you have "new giveplayerid;" anywhere in your script? If so where?
Reply
#3

Код:
new giveplayerid = ReturnUser(tmp);
And I don't get it, because if I delete it, it will always say: Invalid player ID.
I don't get errors on other codes so there must be something wrong in this code. I don't know what. So I don't get it :/
Reply
#4

Search all your scripts (filterscripts, etc.) for "giveplayerid" use the find function. If any have "new" you need to delete one or change the name of it.
Reply
#5

Thanks. Deleted the new O_O
Anyways, Solved.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)