What is wrong in that code Rep+++ -
boyan96 - 19.04.2012
PHP код:
if(GetPlayerScore(playerid) > 1)
{
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName);
format(string, sizeof(string), "{NeWBie}: %s (ID: %d): %s", pName, playerid, text);
SendClientMessageToAll(COLOR_RED, string);
return 0;
}
errors
C:\Users\user\Desktop\gamemode\gamemodes\1.pwn(504 7) : error 001: expected token: ",", but found ":"
Line of Errors
PHP код:
GetPlayerName(playerid, pName, sizeof(pName);
Re: What is wrong in that code Rep+++ -
Bogdan1992 - 19.04.2012
GetPlayerName(playerid, pName, sizeof(pName)); You forgot the other ")"
Re: What is wrong in that code Rep+++ -
Biesmen - 19.04.2012
You didn't close the bracket thing..
pawn Код:
GetPlayerName(playerid, pName, sizeof(pName));
Explanation:
You open GetPlayerName by typing this: GetPlayerName(
Then you open sizeof by typing this: sizeof(
Then you close sizeof by typing this at the end of the sizeof part: )
But you forgot to close GetPlayerName..
Edit: Bogdan was first
Re: What is wrong in that code Rep+++ -
RollTi - 19.04.2012
you miss the brakcet ')'
Late
Re: What is wrong in that code Rep+++ -
boyan96 - 19.04.2012
C:\Users\user\Desktop\gamemode\gamemodes\1.pwn(514 7) : warning 219: local variable "string" shadows a variable at a preceding level
Code of error
PHP код:
new string[128], pName[MAX_PLAYER_NAME];
Re: What is wrong in that code Rep+++ -
RollTi - 19.04.2012
there is already string delete
then just remain this
pawn Код:
new pName[MAX_PLAYER_NAME];
Re: What is wrong in that code Rep+++ -
Biesmen - 19.04.2012
You already defined string, remove new string[128] and just keep new pName[MAX_PLAYER_NAME].
Edit: FU at the post above! Aways too late.. Q_Q
Re: What is wrong in that code Rep+++ -
boyan96 - 19.04.2012
PHP код:
if(realchat)
{
if(GetPlayerScore(playerid) < 200)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "{NeWBie}: %s (ID: %d): %s", pName, playerid, text);
SendClientMessageToAll(COLOR_RED, string);
return 0;
}
if(GetPlayerScore(playerid) < 500)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "{RoOkIe}:: %s (ID: %d): %s", pName, playerid, text);
SendClientMessageToAll(COLOR_RED, string);
return 0;
}
return 0;
}
return 1;
}
and how i can make is player have less 200 score to show before his nickname {NeWBie}
Re: What is wrong in that code Rep+++ -
Biesmen - 19.04.2012
pawn Код:
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
if(GetPlayerScore(playerid) < 200)
{
format(string, sizeof(string), "{NeWBie}: %s (ID: %d): %s", pName, playerid, text);
}
else
{
format(string, sizeof(string), "{RoOkIe}:: %s (ID: %d): %s", pName, playerid, text);
}
SendClientMessageToAll(COLOR_RED, string);
return 0;
Re: What is wrong in that code Rep+++ -
boyan96 - 19.04.2012
this don't work