5 errors in same line
#1

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

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));
Reply
#3

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

I dont know what to show you from the script

can you maybe told me what to show and i will
Reply
#5

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;
}
Reply
#6

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]);
}
Reply
#7

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.
Reply
#8

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

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;
}
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)