(502) : error 017:: undefined symbol "Spelare" (502) : error 017: undefined symbol "Spelare" (502) : error 029: invalid expression, assumed zero
if(strcmp(cmd, "/giverank", true) == 0) { if(PlayerBase[playerid][pLedare] != 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SCM(playerid, COLOR_WHITE, "USAGE: /GiveRank <Player ID> <Rank>"); return 1; } new giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { if(PlayerBase[playerid][pLedare] == PlayerBase[playerid][pLedare] || PlayerBase[giveplayerid][pMedlem] == PlayerBase[playerid][pMedlem]) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SCM(playerid, COLOR_WHITE, "USAGE: /GiveRank <Player ID> <Rank>"); return 1; } new rank = strval(tmp); GetPlayerName(playerid, Spelare, sizeof(Spelare)); GetPlayerName(giveplayerid, Spelare2, sizeof(Spelare2)); if(rank <= 5 && rank >= 1) { format(Text, sizeof(Text), "** Leader %s gave you rank %d! **", Spelare, rank); SCM(giveplayerid, COLOR_BLUE, Text); format(Text, sizeof(Text), "** You gave %s rank %d! **", Spelare2, rank); SCM(playerid, COLOR_BLUE, Text); PlayerBase[giveplayerid][pRank] = rank; UpdateRank(giveplayerid); } else{SCM(playerid, COLOR_RED, "MAIN ERROR(Ranks are between 1-5!)");} } else{SCM(playerid, COLOR_RED, "MAIN ERROR(Player does not belong to your faction!)");} } else{SCM(playerid, COLOR_RED, "MAIN ERROR(That player isn't online!)");} } else{SCM(playerid, COLOR_RED, "MAIN ERROR(You are not a leader!)");} return 1; }
new Spelare[24],Spelare2[24];
GetPlayerName(playerid, Spelare, sizeof(Spelare));
GetPlayerName(giveplayerid, Spelare2, sizeof(Spelare2));
pawn Код:
|
(491) : warning 219: local variable "giveplayerid" shadows a variable at a preceding level i got the warning on this new giveplayerid = ReturnUser(tmp);
new
} else{SCM(playerid, COLOR_RED, "MAIN ERROR(Ranks are between 1-5!)");} } else{SCM(playerid, COLOR_RED, "MAIN ERROR(Player does not belong to your faction!)");} } else{SCM(playerid, COLOR_RED, "MAIN ERROR(That player isn't online!)");} } else{SCM(playerid, COLOR_RED, "MAIN ERROR(You are not a leader!)");} return 1; }