GetPlayerWeaponData - 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: GetPlayerWeaponData (
/showthread.php?tid=472509)
GetPlayerWeaponData -
detter - 28.10.2013
when i use this onplayerdisconnect it doesn't work but if i try it with some random cmd. it works fine...
Код:
public OnPlayerDisconnect(playerid, reason)
{
new am1 ,str[5];
GetPlayerWeaponData(playerid ,0 ,pInfo[playerid][weapons][0] ,am1);
format(str ,5 ,"%i" ,pInfo[playerid][weapons][0] );
SCM(playerid ,-1 ,str); // I get 0
return 1;
}
but...
Код:
CMD:test(playerid ,params[])
{
new am1 ,str[5];
GetPlayerWeaponData(playerid ,0 ,pInfo[playerid][weapons][0] ,am1);
format(str ,5 ,"%i" ,pInfo[playerid][weapons][0] );
SCM(playerid ,-1 ,str); // I get 1 ( as i should because i have boxer..)
return 1;
}
Re: GetPlayerWeaponData -
PaulDinam - 28.10.2013
You're trying to message a player when he disconnects from the server, does that make any sense?
You can either message someone else or log it into a file etc..
Re: GetPlayerWeaponData - Patrick - 28.10.2013
Quote:
Originally Posted by PaulDinam
You're trying to message a player when he disconnects from the server, does that make any sense?
|
That true, you leave the server obviously won't see the message, try printing it instead of using SendClientMessage
This
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new am1 ,str[5];
GetPlayerWeaponData(playerid ,0 ,pInfo[playerid][weapons][0] ,am1);
format(str ,sizeof(str) ,"%i" ,pInfo[playerid][weapons][0] );
SCM(playerid, -1 ,str);
printf("%i", pInfo[playerid][weapons][0] );
return true;
}
Re: GetPlayerWeaponData -
detter - 28.10.2013
that's not the point(i can leave server via gmx so gtasa won't close and i can see all previous msgs)...
Re: GetPlayerWeaponData -
detter - 29.10.2013
*bump
AW: GetPlayerWeaponData -
BigETI - 29.10.2013
After disconnection player stats should be reset by default. Use a some sort of server sided method to get player weapons data.
Re: GetPlayerWeaponData -
detter - 29.10.2013
thanks for clearing it out