LoadVehicles heelp
#1

Hello everyone... There a problem... i need OnPlayerConnect To Server Load To him vehicles owned and in OnPlayerDisconnect Too if A Player leave server Remove His vehicles From Server.

And after connecting again Load To Him his Vehicles...


PHP код:
public OnPlayerConnect(playerid)
{
    
SetPVarInt(playerid"xv_teklif_id"INVALID_PLAYER_ID);
    
SetPVarInt(playerid"xv_teklif_gonderen"INVALID_PLAYER_ID);
    
LoadxVehicleKeys(playerid);
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    if(
GetPVarInt(playerid"xv_teklif_gonderen") != INVALID_PLAYER_ID)
    {
        new 
gonderen GetPVarInt(playerid"xv_teklif_gonderen");
        
KillTimer(offerTimer[playerid]);
        
SetPVarInt(gonderen"xv_teklif_id"INVALID_PLAYER_ID);
        
SendClientMessage(gonderen, -1"{FF0000}[ERROR]:- {DCDC22}Your vehicle offer has cancelled because of the player that you offered has disconnected.");
    }
    if(
GetPVarInt(playerid"xv_teklif_id") != INVALID_PLAYER_ID)
    {
        new 
alan GetPVarInt(playerid"xv_teklif_id");
        
SetPVarInt(alan"xv_teklif_gonderen"INVALID_PLAYER_ID);
        
DeletePVar(alan"xv_teklif_xid");
        
DeletePVar(alan"xv_teklif_fiyat");
        
KillTimer(offerTimer[alan]);
        
SendClientMessage(alan, -1"{FF0000}[ERROR]:- {DCDC22}The offer has cancelled because of the player that make the offer has disconnected.");
    }
    if(
IsPlayerInAnyVehicle(playerid))
    {
        new 
xid xVeh[GetPlayerVehicleID(playerid)], Float:xvHP;
        
GetVehicleHealth(GetPlayerVehicleID(playerid), xvHP);
        if(
xid != && xVehicle[xid][xv_HizliPark] == && !IsVehicleFlipped(GetPlayerVehicleID(playerid)) && xvHP 300)
        {
            
GetVehiclePos(GetPlayerVehicleID(playerid), xVehicle[xid][xv_Pos][0], xVehicle[xid][xv_Pos][1], xVehicle[xid][xv_Pos][2]);
            
GetVehicleZAngle(GetPlayerVehicleID(playerid), xVehicle[xid][xv_Pos][3]);
            
SavexVehicle(xid);
        }
    }
    return 
1;

Reply


Messages In This Thread
LoadVehicles heelp - by Man43 - 20.04.2017, 10:00
Re: LoadVehicles heelp - by Man43 - 20.04.2017, 10:08
Re: LoadVehicles heelp - by skuller12 - 20.04.2017, 10:38
Re: LoadVehicles heelp - by Man43 - 20.04.2017, 10:39
Re: LoadVehicles heelp - by skuller12 - 20.04.2017, 10:46
Re: LoadVehicles heelp - by Man43 - 20.04.2017, 10:51
Re: LoadVehicles heelp - by skuller12 - 20.04.2017, 10:54
Re: LoadVehicles heelp - by Man43 - 20.04.2017, 17:18
Re: LoadVehicles heelp - by Man43 - 20.04.2017, 19:51
Re: LoadVehicles heelp - by Man43 - 21.04.2017, 19:57

Forum Jump:


Users browsing this thread: 2 Guest(s)