%d Wanteds
#1

Hey,

how to get the Wanteds from a Player (Enum)

enum PlayerInfo
{
Adminlevel,
Level,
Fraction,
Team,
sLogin,
Banned,
Prison,
Skin,
pMuted,
aPrison,
Wanteds
};


ocmd: su(playerid,params[])
{
if(IsPlayerCop(playerid))
{
new pid,wid,reason[64];
if(sscanf(params,"uis",pid,wid,reason))return SendClientMessage(playerid,BLAU,"/su [ID] [Wanteds] [Reason]");
if(IsPlayerConnected(playerid))
{
new string[128];
format(string, sizeof(string), "Officer %s has given you %d Wanteds", GetName(playerid),wid);
SendClientMessage(pid, -1, string);
sPlayer[playerid][Wanteds]=sSpieler[playerid][Wanteds]+wid;
}
}
return 1;
}

How to give out the Wanteds?

ocmd:mywtds(playerid,params[])
{
new wid;
new string[128];
format(string, sizeof(string), "You have %d Wanteds!", sSpieler[Wanteds]); I do not know how to query the number of "wanteds"
SendClientMessage(playerid, -1, string);
}
Reply
#2

Try this.

Код:
sPlayer[playerid][Wanteds] += wid;
Код:
ocmd:mywtds(playerid,params[])
{
new wid;
new string[128];
format(string, sizeof(string), "You have %d Wanteds!", sPlayer[playerid][Wanteds]);
SendClientMessage(playerid, -1, string);
}
Reply
#3

Quote:
Originally Posted by Danisoni
Посмотреть сообщение
Try this.

Код:
sPlayer[playerid][Wanteds] += wid;
Код:
ocmd:mywtds(playerid,params[])
{
new wid;
new string[128];
format(string, sizeof(string), "You have %d Wanteds!", sPlayer[playerid][Wanteds]);
SendClientMessage(playerid, -1, string);
}
thx!
Reply
#4

Hello!

PHP код:
sPlayer[playerid][Wanteds]=sSpieler[playerid][Wanteds]+wid
PHP код:
sPlayer[playerid][Wanteds] += wid
You have a little mistake. When you use "playerid" then the cop is going to get the wanteds. So you have to use pid.

PHP код:
sPlayer[pid][Wanteds]=sSpieler[pid][Wanteds]+wid
So it's should be correct.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)