SA-MP Forums Archive
%d Wanteds - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: %d Wanteds (/showthread.php?tid=643795)



%d Wanteds - pulsare - 27.10.2017

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);
}


Re: %d Wanteds - Danisoni - 27.10.2017

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);
}



Re: %d Wanteds - pulsare - 27.10.2017

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!


Re: %d Wanteds - Mencent - 28.10.2017

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.