18.08.2010, 00:08
I cant get this cmd to work, i got error on line 502. I dont know in what way to define it
Its on " GetPlayerName(playerid, Spelare, sizeof(Spelare)); "
Код:
(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; }