OnPlayerDisconnect Problem
#1

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?
Reply
#2

Show us your Code, from the Logout and Login
Reply
#3

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

...well you are saving the user under OnPlayerDisconnect

So post this
Reply
#5

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]);
Reply
#6

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

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)