new PlayerName[MAX_PLAYER_NAME], string[128]; //file[256];
GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
new tmp3[50]; GetPlayerIp(playerid,tmp3,50);
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
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));
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; }
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; } |
CMD:savestats(playerid, params)
{
if(Logged[playerid] != 1) return SendClientMessage(playerid, -1, "Not logged in");
SaveStats(playerid);
return 1;
}
stock SaveStats(playerid)
{
new PlayerFile[150];
format(PlayerFile, sizeof(PlayerFile), "users/%s.ini", PlayerName(playerid));
dini_IntSet(PlayerFile, "Money", PlayerInfo[playerid][PMoney]);
}
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.
|
CMD:savestats(playerid, params[]) { if(Logged[playerid] != 1) return SendClientMessage(playerid, -1, "Not logged in"); SaveStats(playerid); return 1; }
CMD:savestats(playerid, params[]) { if(Logged[playerid] != 1) return SendClientMessage(playerid, -1, "Not logged in"); SaveStats(playerid); return 1; }