Code causing: UNKNOWN COMMAND
#1

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?
Reply
#2

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

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
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)