29.01.2012, 04:58
This is the command. It only shows that it is locked for you, but not anybody else.
PHP Code:
command(lock, playerid, params[])
{
new string[256];
if(Player[playerid][PlayerCarModel] > 0 && IsPlayerInRangeOfVehicle(playerid, Player[playerid][CarLinkID], 4))
{
if(Player[playerid][CarLinkID] > 0)
{
if(Player[playerid][LockedCar] == 0)
{
Player[playerid][LockedCar] = 1;
format(string, sizeof(string), "* %s takes out their keys and locks their car.", GetName(playerid));
NearByMessage(playerid, NICESKY, string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(i == playerid)
{
SetVehicleParamsForPlayer(Player[playerid][CarLinkID], i, 0, 1);
}
}
return 1;
}
else
{
format(string, sizeof(string), "* %s takes out their keys and unlocks their car.", GetName(playerid));
NearByMessage(playerid, NICESKY, string);
Player[playerid][LockedCar] = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetVehicleParamsForPlayer(Player[playerid][CarLinkID], i, 0, 0);
}
return 1;
}
}
}
}