01.06.2012, 15:51 
	
	
	
		Hey!
Well i have been creating a lock command for when you are near your 1st, 2nd or 3rd car and you do /lock it unlocks it but it never works i have tried everything to try and make this work but it just wont
Would appreciate it if someone could help me
Thanks
If you need more code just ask
	
	
	
	
Well i have been creating a lock command for when you are near your 1st, 2nd or 3rd car and you do /lock it unlocks it but it never works i have tried everything to try and make this work but it just wont
Would appreciate it if someone could help me
Thanks
pawn Code:
command(lock, playerid, params[])
{
#pragma unused params
new engine, lights, alarm, doors, bonnet, boot, objective, string[128];
if(Player[playerid][PlayerCarModel] > 0)
{
if(IsPlayerInRangeOfVehicle(playerid, Player[playerid][CarLinkID], 10))
{
if(Player[playerid][CarLinkID] > 0)
{
if(Player[playerid][LockedCar] == 0)
{
Player[playerid][LockedCar] = 1;
format(string, sizeof(string), "%s has locked their vehicle");
NearByMessage(playerid, PURPLE, string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(i != playerid)
{
GetVehicleParamsEx(Player[playerid][CarLinkID], engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(Player[playerid][CarLinkID], engine, lights, alarm, 1, bonnet, boot, 0);
}
}
return 1;
}
else
{
Player[playerid][LockedCar] = 0;
format(string, sizeof(string),"%s has unlocked their vehicle");
NearByMessage(playerid, PURPLE, string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
GetVehicleParamsEx(Player[playerid][CarLinkID], engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(Player[playerid][CarLinkID], engine, lights, alarm, 0, bonnet, boot, 0);
}
}
}
else
{
SendClientMessage(playerid, WHITE, "You do not own a car");
}
}
else
{
SendClientMessage(playerid, WHITE, "You are not near any of your vehicles");
}
}
return 1;
}


