GetPlayerWeaponData
#1

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;
}
Reply
#2

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..
Reply
#3

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;
}
Reply
#4

that's not the point(i can leave server via gmx so gtasa won't close and i can see all previous msgs)...
Reply
#5

*bump
Reply
#6

After disconnection player stats should be reset by default. Use a some sort of server sided method to get player weapons data.
Reply
#7

thanks for clearing it out
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)