park,lock for LSR member
#1

How can i make that lsr members can park,lock all owned vehicles

I think i need to add this
Код:
if(!IsALSR(playerid))
but where ??

Parking script
Код:
	if(GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pVeh] && GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pVVeh]) return SendClientMessage(playerid, COLOR_GREY, "You are not in a vehicle you can park.");
	SendClientMessage(playerid, COLOR_LIGHTBLUE, " You have parked your vehicle, it will always spawn here until you park it somewhere else.");
	if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVeh])
	
	{
		for(new i=0; i<14; i++)
		{
		    PlayerInfo[playerid][pVehMod][i] = GetVehicleComponentInSlot(PlayerInfo[playerid][pVeh], i);
		}
		GetVehiclePos(PlayerInfo[playerid][pVeh],PlayerInfo[playerid][vX], PlayerInfo[playerid][vY], PlayerInfo[playerid][vZ]);
		GetVehicleZAngle(PlayerInfo[playerid][pVeh],PlayerInfo[playerid][vA]);
		DestroyVehicle(PlayerInfo[playerid][pVeh]);
		PlayerInfo[playerid][pVeh] = CreateVehicle(PlayerInfo[playerid][vModel], PlayerInfo[playerid][vX], PlayerInfo[playerid][vY], PlayerInfo[playerid][vZ],PlayerInfo[playerid][vA],PlayerInfo[playerid][vC1],PlayerInfo[playerid][vC2],1200);
	    ChangeVehiclePaintjob(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][vPJ]);
		for(new i=0; i<14; i++)
		{
		    AddVehicleComponent(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][pVehMod][i]);
		}
	}
	else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVVeh])
	{
		for(new i=0; i<14; i++)
		{
		    PlayerInfo[playerid][pVVehMod][i] = GetVehicleComponentInSlot(PlayerInfo[playerid][pVVeh], i);
		}
		GetVehiclePos(PlayerInfo[playerid][pVVeh],PlayerInfo[playerid][vVX], PlayerInfo[playerid][vVY], PlayerInfo[playerid][vVZ]);
		GetVehicleZAngle(PlayerInfo[playerid][pVVeh],PlayerInfo[playerid][vVA]);
		DestroyVehicle(PlayerInfo[playerid][pVVeh]);
		PlayerInfo[playerid][pVVeh] = CreateVehicle(PlayerInfo[playerid][vVModel], PlayerInfo[playerid][vVX], PlayerInfo[playerid][vVY], PlayerInfo[playerid][vVZ],PlayerInfo[playerid][vVA],PlayerInfo[playerid][vVC1],PlayerInfo[playerid][vVC2],1200);
	    ChangeVehiclePaintjob(PlayerInfo[playerid][pVVeh], PlayerInfo[playerid][vVPJ]);
		for(new i=0; i<14; i++)
		{
		    AddVehicleComponent(PlayerInfo[playerid][pVVeh], PlayerInfo[playerid][pVVehMod][i]);
		}
	}
And a lock
Код:
	if(PlayerInfo[playerid][pVeh] || PlayerInfo[playerid][pVVeh])
    {
        new Float:vx, Float:vy, Float:vz;
	    GetVehiclePos(PlayerInfo[playerid][pVeh], vx, vy, vz);
	    if(IsPlayerInRangeOfPoint(playerid, 3, vx, vy, vz))
	    {
	        idx = PlayerInfo[playerid][pVeh];
	        new engine, lights, alarm, doors, bonnet, boot, objective;
			GetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, boot, objective);
			if(doors)
			{

			    SetVehicleParamsEx(idx, engine, lights, alarm, 0, bonnet, boot, objective);
			    PlayerInfo[playerid][vLocked] = 0;
			    format(string, sizeof(string), "* %s takes out their vehicle keys and unlocks it.", RPN(playerid));
				SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
				GameTextForPlayer(playerid, "~g~Vehicle Unlocked", 3500, 3);
			}
			else
			{
			    SetVehicleParamsEx(idx, engine, lights, alarm, 1, bonnet, boot, objective);
			    PlayerInfo[playerid][vLocked] = 1;
			    format(string, sizeof(string), "* %s takes out their vehicle keys and locks it.", RPN(playerid));
				SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
				GameTextForPlayer(playerid, "~r~Vehicle Locked", 3500, 3);
			}
			lockdone = 1;
			return 1;
	    }
	    GetVehiclePos(PlayerInfo[playerid][pVVeh], vx, vy, vz);
	    if(IsPlayerInRangeOfPoint(playerid, 3, vx, vy, vz))
	    {
	        idx = PlayerInfo[playerid][pVVeh];
	        new engine, lights, alarm, doors, bonnet, boot, objective;
			GetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, boot, objective);
			if(doors)
			{

			    SetVehicleParamsEx(idx, engine, lights, alarm, 0, bonnet, boot, objective);
			    PlayerInfo[playerid][vVLocked] = 0;
			    format(string, sizeof(string), "* %s takes out their vehicle keys and unlocks it.", RPN(playerid));
				SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
				GameTextForPlayer(playerid, "~g~Vehicle Unlocked", 3500, 3);
			}
			else
			{
			    SetVehicleParamsEx(idx, engine, lights, alarm, 1, bonnet, boot, objective);
			    PlayerInfo[playerid][vVLocked] = 1;
			    format(string, sizeof(string), "* %s takes out their vehicle keys and locks it.", RPN(playerid));
				SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
				GameTextForPlayer(playerid, "~r~Vehicle Locked", 3500, 3);
			}
			lockdone = 1;
	    }
	    return 1;
    }
    if(!lockdone)
	{
	    SendClientMessage(playerid, COLOR_GREY, "You are not near something you can lock/unlock.");
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)