functions problem
#1

Hi all,i've this code in my gm.

pawn Код:
for(new i=0; i<=MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i)) SavePlayer(i) SavePlayerVip(i);;
    }
1st is to save player stats and 2nd is to save vip players.

But i get this:

error 001: expected token: ";", but found "-identifier-"
error 036: empty statement
Reply
#2

[QUOTE=Logitech90;1029002]Hi all,i've this code in my gm.

pawn Код:
for(new i=0; i<=MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i)) SavePlayer(i) SavePlayerVip(i);;
    }
Ah, remove ";" from the end...
Reply
#3

Yes,already tried

But i get:

error 001: expected token: ";", but found "-identifier-"
Reply
#4

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i)) SavePlayer(i) SavePlayerVip(i);
}
Not sure, try.
Reply
#5

pawn Код:
for(new i=0; i<=MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
        SavePlayer(i);
        SavePlayerVip(i);
    }
}
GOD DAMNIT the indentation is fucked up by the forums
Edit: There we go
Reply
#6

Same :S

Edit: I fixed with Mike's code,thanks.
Reply
#7

ok guys here is a basic structure thing of coding languages...
in case you are using an "if" you have to define the beginning and the end of this check.
In case there is only one thing that should be done after the if you can write it straight behind...
e.g.:
pawn Код:
if(IsPlayerConnect(playerid)) SendClientMessage(playerid, 0x999999AA, "You are a noob");
but if there is more than 1 thing to be executed, you have to define the beginning and the end by using { and } in pwn...
like:
pawn Код:
if(IsPlayerConnected(playerid))
{
    SendClientMessage(playerid, 0x999999AA, "You are a noob");
    Kick(playerid);
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)