01.12.2018, 13:55
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_PASSENGER)
{
SetPlayerArmedWeapon(playerid,0);
}
if(newstate == PLAYER_STATE_PASSENGER)
{
if(newstate == PLAYER_STATE_PASSENGER)
{
new gun,tmp;
GetPlayerWeaponData(playerid,4,gun,tmp);
#pragma unused tmp
if(gun)SetPlayerArmedWeapon(playerid,gun);
else SetPlayerArmedWeapon(playerid,0);
}
}
if(newstate == PLAYER_STATE_DRIVER && oldstate != PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
// if(!engine) SendClientMessage(playerid, COLOR_WHITE, "You can start or stop the vehicle's engine using {FF6347}/engine{FFFFFF}.");
if(!engine) GameTextForPlayer(playerid, "~w~/engine to turn on/off the vehicle engine.", 3500, 3);
//if(!PlayerInfo[playerid][pCarLic]) SendClientMessage(playerid, COLOR_LIGHTRED, " You don't have a drivers license, beware of cops.");
//if(IsATowTruck(vehicleid)) SendClientMessage(playerid, COLOR_WHITE, "You can tow a vehicle using {FF6347}/tow{FFFFFF}.");
}
return 1;
}
{
if(newstate == PLAYER_STATE_PASSENGER)
{
SetPlayerArmedWeapon(playerid,0);
}
if(newstate == PLAYER_STATE_PASSENGER)
{
if(newstate == PLAYER_STATE_PASSENGER)
{
new gun,tmp;
GetPlayerWeaponData(playerid,4,gun,tmp);
#pragma unused tmp
if(gun)SetPlayerArmedWeapon(playerid,gun);
else SetPlayerArmedWeapon(playerid,0);
}
}
if(newstate == PLAYER_STATE_DRIVER && oldstate != PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
// if(!engine) SendClientMessage(playerid, COLOR_WHITE, "You can start or stop the vehicle's engine using {FF6347}/engine{FFFFFF}.");
if(!engine) GameTextForPlayer(playerid, "~w~/engine to turn on/off the vehicle engine.", 3500, 3);
//if(!PlayerInfo[playerid][pCarLic]) SendClientMessage(playerid, COLOR_LIGHTRED, " You don't have a drivers license, beware of cops.");
//if(IsATowTruck(vehicleid)) SendClientMessage(playerid, COLOR_WHITE, "You can tow a vehicle using {FF6347}/tow{FFFFFF}.");
}
return 1;
}