What is wrong in that code Rep+++
#1

PHP код:
if(GetPlayerScore(playerid) > 1)
{
 new 
string[128], pName[MAX_PLAYER_NAME];
 
GetPlayerName(playeridpNamesizeof(pName);
 
format(stringsizeof(string), "{NeWBie}: %s (ID: %d): %s"pNameplayeridtext);
 
SendClientMessageToAll(COLOR_REDstring);
 return 
0;

errors
C:\Users\user\Desktop\gamemode\gamemodes\1.pwn(504 7) : error 001: expected token: ",", but found ":"

Line of Errors
PHP код:
 GetPlayerName(playeridpNamesizeof(pName); 
Reply
#2

GetPlayerName(playerid, pName, sizeof(pName)); You forgot the other ")"
Reply
#3

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

you miss the brakcet ')'

Late
Reply
#5

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

there is already string delete

pawn Код:
new string[128];
then just remain this

pawn Код:
new pName[MAX_PLAYER_NAME];
Reply
#7

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

PHP код:
if(realchat)
    {
 if(
GetPlayerScore(playerid) < 200)
{
 new 
pName[MAX_PLAYER_NAME];
 
GetPlayerName(playeridpNamesizeof(pName));
 
format(stringsizeof(string), "{NeWBie}: %s (ID: %d): %s"pNameplayeridtext);
 
SendClientMessageToAll(COLOR_REDstring);
 return 
0;
}
if(
GetPlayerScore(playerid) < 500)
{
 new 
pName[MAX_PLAYER_NAME];
 
GetPlayerName(playeridpNamesizeof(pName));
 
format(stringsizeof(string), "{RoOkIe}:: %s (ID: %d): %s"pNameplayeridtext);
 
SendClientMessageToAll(COLOR_REDstring);
 return 
0;
}
        return 
0;
    }
    return 
1;

and how i can make is player have less 200 score to show before his nickname {NeWBie}
Reply
#9

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

this don't work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)