18.01.2015, 22:01
How would i go about restricting the army Tanks and Hunters to the Army Skin ONLY?
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 425 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 432)
{
if(GetPlayerSkin(playerid) != 287)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
SetPlayerPos(playerid,x,y,z+3);
SendClientMessage(playerid,-1,"Army members can only use this vehicle!");
}
}
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new model = GetVehicleModel(GetPlayerVehicleID(playerid));
if((model == 425) || (model == 432))
{
if(GetPlayerSkin(playerid) != 287))
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, -1, "This vehicle is for army only!");
}
}
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new playerskin = GetPlayerSkin(playerid);
new vehid = GetVehicleModel(GetPlayerVehicleID(playerid);
if(playerskin != 287)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_ENTER_VEHICLE_DRIVER)
{
if(vehid == 425) || vehid == 432)
{
ClearAnimations(playerid);
SendClientMessage(playerid, -1 ,"You require to be a part of the army in order to enter this Hunter.");
}
else if(vehid == 432)
{
ClearAnimations(playerid);
SendClientMessage(playerid, -1 ,"You require to be a part of the army in order to enter this Rhino.");
}
}
}
return 1;
}