SA-MP Forums Archive
OnPlayerDisconnect Problem - 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: OnPlayerDisconnect Problem (/showthread.php?tid=567158)



OnPlayerDisconnect Problem - mamalzeus - 11.03.2015

Hi Guys.
I have a problem : when my user disconnect from server His/Here vehicle don't remove

Or for example he had $200 cash and when he connect again his cash is 400 (( when player connect GivePlayerMoney[playerid][pCash] )) .

I think when player disconnect His/Her Cash should be save and = 0 , Or his/her vehicle should be remove.
But How do you do it?


AW: OnPlayerDisconnect Problem - Kaliber - 11.03.2015

Show us your Code, from the Logout and Login


Re: OnPlayerDisconnect Problem - mamalzeus - 11.03.2015

I don't Have any code for logout O_o
It's my mistake?


AW: OnPlayerDisconnect Problem - Kaliber - 11.03.2015

...well you are saving the user under OnPlayerDisconnect

So post this


Re: OnPlayerDisconnect Problem - mamalzeus - 11.03.2015

I don't Save my user
I'm Newcomer in pawno
Help me
I just use code for Player Login for Example:

PlayerInfo[playerid][pCash] = cache_get_row_int(0,11,handle); GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);


AW: Re: OnPlayerDisconnect Problem - Kaliber - 11.03.2015

Quote:
Originally Posted by mamalzeus
Посмотреть сообщение
I just use code for Player Login for Example:
Then look at some tutorials

Like this: https://sampforum.blast.hk/showthread.php?tid=485633

or ****** for some other


Re: AW: Re: OnPlayerDisconnect Problem - mamalzeus - 13.03.2015

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
Then look at some tutorials

Like this: https://sampforum.blast.hk/showthread.php?tid=485633

or ****** for some other
My code is here
__________________________________________________ ___________
public OnPlayerDisconnect(playerid, reason)
{
if(PlayerInfo[playerid][pVeh] != 0)
{
DestroyVehicle(PlayerInfo[playerid][pVeh]);
}
return 1;
}

public OnPlayerLogin(playerid)
{
if(IsPlayerConnected(playerid))
{
PlayerInfo[playerid][pVeh] = cache_get_row_int(0,34,handle);
CreateVehicle(PlayerInfo[playerid][pVeh], 1558.9827, -2255.3311, 13.1182, 90.000, -1, -1, 60);
}
return 1;
}
__________________________________________________ ___________________________


were is problem for destroy vehicle?