SA-MP Forums Archive
Code causing: UNKNOWN COMMAND - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Code causing: UNKNOWN COMMAND (/showthread.php?tid=227040)



Code causing: UNKNOWN COMMAND - Anteino - 16.02.2011

So a piece of my code is this:

pawn Code:
stock RaceAccept(playerid){
    if(PlayerInvite[playerid] == -1){
        SendClientMessage(playerid, COLOR_WHITE, "You weren't invited to any races.");
        return 1;
    }
    new i;
    for(i = 1; i < MAX_CHECKPOINTS * 3 + 1; i++){
        CreatedRace[playerid][i] = CreatedRace[PlayerInvite[playerid]][i];
    }
    return 1;
}
When I perform the code trough playercommandtext it says unknown command. But when I delete
pawn Code:
new i;
    for(i = 1; i < MAX_CHECKPOINTS * 3 + 1; i++){
        CreatedRace[playerid][i] = CreatedRace[PlayerInvite[playerid]][i];
    }
It'll work fine for the rest. What is going wrong :S?


Re: Code causing: UNKNOWN COMMAND - Leon_Rahil! - 16.02.2011

Try
pawn Code:
for (new i = 1; i < MAX_CHECKPOINTS * 3 + 1; i++)
{
 CreatedRace[playerid][i] = CreatedRace[PlayerInvite[playerid]][i];
}



Re: Code causing: UNKNOWN COMMAND - Anteino - 17.02.2011

Quote:
Originally Posted by Leon_Rahil!
View Post
Try
pawn Code:
for (new i = 1; i < MAX_CHECKPOINTS * 3 + 1; i++)
{
 CreatedRace[playerid][i] = CreatedRace[PlayerInvite[playerid]][i];
}
Nope still doesn't work :S


Re: Code causing: UNKNOWN COMMAND - Antonio [G-RP] - 17.02.2011

pawn Code:
CreatedRace[playerid][i] = CreatedRace[PlayerInvite[playerid]][i];
I believe it has to do with this line.