SA-MP Forums Archive
5 errors in same line - 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)
+--- Thread: 5 errors in same line (/showthread.php?tid=512978)



5 errors in same line - salev13 - 13.05.2014

Please help i got 5 errors in same line

Line:

pawn Код:
new PlayerName[MAX_PLAYER_NAME], string[128]; //file[256];
    GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
    new tmp3[50]; GetPlayerIp(playerid,tmp3,50);
Errors:

pawn Код:
C:\Users\shalev\Desktop\Samp Server\gamemodes\codwaw32.pwn(6187) : error 001: expected token: "-identifier-", but found "["
C:\Users\shalev\Desktop\Samp Server\gamemodes\codwaw32.pwn(6188) : error 029: invalid expression, assumed zero
C:\Users\shalev\Desktop\Samp Server\gamemodes\codwaw32.pwn(6188) : warning 215: expression has no effect
C:\Users\shalev\Desktop\Samp Server\gamemodes\codwaw32.pwn(6188) : error 001: expected token: ";", but found ")"
C:\Users\shalev\Desktop\Samp Server\gamemodes\codwaw32.pwn(6188) : error 029: invalid expression, assumed zero
C:\Users\shalev\Desktop\Samp Server\gamemodes\codwaw32.pwn(6188) : fatal error 107: too many error messages on one line



Re: 5 errors in same line - iZN - 13.05.2014

If this doesn't works then show some above lines, before 'new PlayerName[....'

pawn Код:
new PlayerName[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
new tmp3[16]; // you don't really need 50 for this, 16 is enough!
GetPlayerIp(playerid, tmp3, sizeof(tmp3));



Re: 5 errors in same line - Andreas1331 - 13.05.2014

I get no errors running this bit of code, so it must be something else that affects this. Perhaps you could post some more without revealing too much of your script?


Re: 5 errors in same line - salev13 - 13.05.2014

I dont know what to show you from the script

can you maybe told me what to show and i will


Re: 5 errors in same line - Andreas1331 - 13.05.2014

Like where are you using this? What are your intentions with it.
Is it inside a command like this?


Код:
CMD:whatever(playerid, params[])
{
    new PlayerName[MAX_PLAYER_NAME], string[128]; //file[256];
    GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
    new tmp3[50]; GetPlayerIp(playerid,tmp3,50);
    // MORE CODE OF COURSE
    return 1;
}



Re: 5 errors in same line - salev13 - 13.05.2014

Quote:
Originally Posted by Andreas1331
Посмотреть сообщение
Like where are you using this? What are your intentions with it.
Is it inside a command like this?


Код:
CMD:whatever(playerid, params[])
{
    new PlayerName[MAX_PLAYER_NAME], string[128]; //file[256];
    GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
    new tmp3[50]; GetPlayerIp(playerid,tmp3,50);
    // MORE CODE OF COURSE
    return 1;
}
I think here becuase when i put it thats did the errors

pawn Код:
CMD:savestats(playerid, params)
{
    if(Logged[playerid] != 1) return SendClientMessage(playerid, -1, "Not logged in");
    SaveStats(playerid);
    return 1;
}
And the Stock

pawn Код:
stock SaveStats(playerid)
{
    new PlayerFile[150];
    format(PlayerFile, sizeof(PlayerFile), "users/%s.ini", PlayerName(playerid));
    dini_IntSet(PlayerFile, "Money", PlayerInfo[playerid][PMoney]);
}



Re: 5 errors in same line - Konstantinos - 13.05.2014

Make a decision. PlayerName will be either a name of an array to store the player's name or the name of a function that returns the player's name. You cannot use the same name for both uses.


Re: 5 errors in same line - salev13 - 13.05.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Make a decision. PlayerName will be either a name of an array to store the player's name or the name of a function that returns the player's name. You cannot use the same name for both uses.
So what to do if i cant use it on few functions


Re: 5 errors in same line - ball - 13.05.2014

Replace you command savestats with this below

Код:
CMD:savestats(playerid, params[])
{
    if(Logged[playerid] != 1) return SendClientMessage(playerid, -1, "Not logged in");
    SaveStats(playerid);
    return 1;
}



Re: 5 errors in same line - Andreas1331 - 13.05.2014

Also
Код:
CMD:savestats(playerid, params[])
{
    if(Logged[playerid] != 1) return SendClientMessage(playerid, -1, "Not logged in");
    SaveStats(playerid);
    return 1;
}
You were missing the [] at the end of the first line.