PDA

View Full Version : /stats - Need help with that


vent
22/11/2011, 01:13 PM
So, this code

public Andmed(playerid,targetid)
{
if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
{
new raha = GetPlayerMoney(targetid);
new nimi[MAX_PLAYER_NAME];
GetPlayerName(targetid, nimi, sizeof(nimi));
SendClientMessage(playerid, COLOR_WHITE,"____________");
format(string, sizeof(string),"*** %s ***",nimi);
SendClientMessage(playerid, COLOR_WHITE,string);
format(string, sizeof(string), "Raha:[$%d]",raha);
SendClientMessage(playerid, COLOR_WHITE,string);
//format(string, sizeof(string), "Hoiatusi:[%d/5]", warns);
//SendClientMessage(playerid, COLOR_WHITE,string);
SendClientMessage(playerid, COLOR_WHITE,"____________");
}
}

will give


error 017: undefined symbol "string"
error 017: undefined symbol "string"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

Somebody?

Pinguinn
22/11/2011, 01:16 PM
You forgot
new string[128];



public Andmed(playerid,targetid)
{
if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
{
new raha = GetPlayerMoney(targetid), string[128];
new nimi[MAX_PLAYER_NAME];
GetPlayerName(targetid, nimi, sizeof(nimi));
SendClientMessage(playerid, COLOR_WHITE,"____________");
format(string, sizeof(string),"*** %s ***",nimi);
SendClientMessage(playerid, COLOR_WHITE,string);
format(string, sizeof(string), "Raha:[$%d]",raha);
SendClientMessage(playerid, COLOR_WHITE,string);
//format(string, sizeof(string), "Hoiatusi:[%d/5]", warns);
//SendClientMessage(playerid, COLOR_WHITE,string);
SendClientMessage(playerid, COLOR_WHITE,"____________");
}
}

Kostas'
22/11/2011, 01:17 PM
public Andmed(playerid,targetid)
{
if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
{
new string[128], raha = GetPlayerMoney(targetid), nimi[MAX_PLAYER_NAME];
GetPlayerName(targetid, nimi, sizeof(nimi));
SendClientMessage(playerid, COLOR_WHITE,"____________");
format(string, sizeof(string),"*** %s ***",nimi);
SendClientMessage(playerid, COLOR_WHITE,string);
format(string, sizeof(string), "Raha:[$%d]",raha);
SendClientMessage(playerid, COLOR_WHITE,string);
//format(string, sizeof(string), "Hoiatusi:[%d/5]", warns);
//SendClientMessage(playerid, COLOR_WHITE,string);
SendClientMessage(playerid, COLOR_WHITE,"____________");
}
}

vent
22/11/2011, 01:21 PM
Yea, riight.
Now.

public Andmed(playerid,targetid)
{
if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
{
new string[128];
new raha = GetPlayerMoney(targetid);
new hoiatusi = PlayerInfo[playerid][pHoiatusi]; //warns
new kiitusi = PlayerInfo[targetid][pKiitusi]; // opposite of warns :D
new nimi[MAX_PLAYER_NAME];
GetPlayerName(targetid, nimi, sizeof(nimi));
SendClientMessage(playerid, COLOR_WHITE,"____________");
format(string, sizeof(string),"*** %s ***",nimi);
SendClientMessage(playerid, COLOR_WHITE,string);
format(string, sizeof(string), "Raha:[$%d]",raha);
SendClientMessage(playerid, COLOR_WHITE,string);
format(string, sizeof(string), "Hoiatusi:[%d/5] | Kiitusi:[%d]", hoiatusi, kiitusi);
SendClientMessage(playerid, COLOR_WHITE,string);
SendClientMessage(playerid, COLOR_WHITE,"____________");
}
}

will give this:

error 017: undefined symbol "PlayerInfo"
error 017: undefined symbol "PlayerInfo"

on these lines:

new hoiatusi = PlayerInfo[playerid][pHoiatusi]; //warns
new kiitusi = PlayerInfo[targetid][pKiitusi]; // opposite of warns :D

EDIT: nvm, i loaded Andmed() before new PlayerInfo[MAX_PLAYERS][pInfo];

Hoborific
22/11/2011, 01:23 PM
Show us your enumerator for "PlayerInfo"

As it's probably a capslock sensitive issue, I doubt it's not defined.

Kostas'
22/11/2011, 01:23 PM
You don't have PlayerInfo as variable ?

vent
22/11/2011, 01:24 PM
nvm, i loaded Andmed() before new PlayerInfo[MAX_PLAYERS][pInfo];