PlayerInfo...Help...Fix it pls
#1

Hello!

Can someone fix my code? I get 4 errors on this line...

Line:

PHP код:
    format(str2sizeof(str2), "{E61A1A}Kills:{DFF709} %d {E61A1A}Deaths:{DFF709} %d"PLAYER_KILLS(player1), PLAYER_DEATHS(player1)); 
Errors:

PHP код:
C:\Users\tadej\Desktop\SA-MP Server\gamemodes\New.pwn(1097) : error 012invalid function callnot a valid address
C
:\Users\tadej\Desktop\SA-MP Server\gamemodes\New.pwn(1097) : warning 215expression has no effect
C
:\Users\tadej\Desktop\SA-MP Server\gamemodes\New.pwn(1097) : error 001expected token";"but found ")"
C:\Users\tadej\Desktop\SA-MP Server\gamemodes\New.pwn(1097) : error 029invalid expressionassumed zero
C
:\Users\tadej\Desktop\SA-MP Server\gamemodes\New.pwn(1097) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors

This is the whole code:

Code:

PHP код:
CMD:playerinfo(playeridparams[])
{
    if(
gPlayerInfo[playerid][PLAYER_LEVEL] < 2)return SendClientMessage(playeridCOLOR_RED,"You are Not Allowed To Use This Command!");
    new 
player1string[120], str[120], str1[60], str2[200];
    if(
sscanf(params,"d"player1)) return SendClientMessage(playeridCOLOR_ORANGE,"Usage: /playerinfo [playerid] ");
    if(!
IsPlayerConnected(player1)) return SendClientMessage(playeridCOLOR_RED,"ERROR: This Player is Not Connected!");
    new 
Float:healthFloat:armourFloat:xFloat:yFloat:z;
    
GetPlayerPos(player1xyz);
    
GetPlayerArmour(player1armour);
    
GetPlayerHealth(player1health);
    
format(stringsizeof(string), "| ----------- Player's Informations -------- |");
    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
    
format(strsizeof(str),"Health:{DFF709} %1f {E61A1A}Armour:{DFF709} %1f {E61A1A}Money:{DFF709} $%d {E61A1A}Score:{DFF709} %d"healtharmourGetPlayerMoney(player1), GetPlayerScore(player1));
    
SendClientMessage(playeridCOLOR_LIGHTREDstr);
    
format(str1sizeof(str1),"Position:{DFF709} %1f, %1f, %1f"xyz);
    
SendClientMessage(playeridCOLOR_LIGHTREDstr1);
    
format(str2sizeof(str2), "{E61A1A}Kills:{DFF709} %d {E61A1A}Deaths:{DFF709} %d"PLAYER_KILLS(player1), PLAYER_DEATHS(player1));
    
SendClientMessage(playeridCOLOR_LIGHTREDstr2);
    return 
1;

Thanks for your help
Reply
#2

format(string, sizeof(string), "| ----------- Player's Informations -------- |");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

This is pretty LOL why do you need to format?....
SendClientMessage(playerid, COLOR_LIGHTBLUE, "| ----------- Player's Informations -------- |");
Reply
#3

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
format(string, sizeof(string), "| ----------- Player's Informations -------- |");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

This is pretty LOL why do you need to format?....
SendClientMessage(playerid, COLOR_LIGHTBLUE, "| ----------- Player's Informations -------- |");
Idk, but that's not help me a lot...
Reply
#4

Anyone?
Reply
#5

Where did you have defined those functions? "PLAYER_KILLS" and "PLAYER_DEATHS"
Reply
#6

Quote:
Originally Posted by RootKiller
Посмотреть сообщение
Where did you have defined those functions? "PLAYER_KILLS" and "PLAYER_DEATHS"
PHP код:
enum PLAYER_MAIN
{
     
PLAYER_NAME[MAX_PLAYER_NAME],
     
PLAYER_IP[16],
     
PLAYER_REGGED,
     
PLAYER_PASS,
     
PLAYER_LEVEL,
     
PLAYER_MONEY,
     
PLAYER_SCORE,
     
PLAYER_MUTED,
     
PLAYER_MUTE_TIME,
     
PLAYER_KILLS,
     
PLAYER_DEATHS

Reply
#7

Use.... PlayerData[playerid][PLAYER_KILLS] or whatever your PlayerData variable is your trying to call your enum values as a function
Reply
#8

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
Use.... PlayerData[playerid][PLAYER_KILLS] or whatever your PlayerData variable is your trying to call your enum values as a function
Well...Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)