new EnteredVehicle[MAX_PLAYERS], engine, lights, alarm, doors, bonnet, boot, objective; public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER) { EnteredVehicle[playerid] = GetPlayerVehicleID(playerid); } } CMD:lock(playerid, params[]) { GetVehicleParamsEx(EnteredVehicle[playerid], engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(EnteredVehicle[playerid], engine, lights, alarm, 1, bonnet, boot, objective); SendClientMessage(playerid, COLOR_GREEN, "Vehicle Locked!"); return 1; }
new EnteredVehicle[MAX_PLAYERS], engine, lights, alarm, doors, bonnet, boot, objective;
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
EnteredVehicle[playerid] = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(EnteredVehicle[playerid], engine, lights, alarm, doors, bonnet, boot, objective);
if(doors == 1)
{
//Remove Player From Vehicle Here
GameTextForPlayer(playerid, "~r~Vehicle Locked!", 5000, 5);
}
}
}
CMD:lock(playerid, params[])
{
GetVehicleParamsEx(EnteredVehicle[playerid], engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(EnteredVehicle[playerid], engine, lights, alarm, 1, bonnet, boot, objective);
SendClientMessage(playerid, COLOR_GREEN, "Vehicle Locked!");
return 1;
}
Actually, I think this function is meant to be used with OnPlayerEnterVehicle...
|
warning 203: symbol is never used: "lock"
Oh lol, put CMD:lock(playerid,params[]) with the rest of the commands.
|
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
EnteredVehicle[playerid] = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(EnteredVehicle[playerid], engine, lights, alarm, doors, bonnet, boot, objective);
if(doors == 1)
{
//Remove Player From Vehicle Here
GameTextForPlayer(playerid, "~r~Vehicle Locked!", 5000, 5);
}
}
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
EnteredVehicle[playerid] = vehicleid;
GetVehicleParamsEx(EnteredVehicle[playerid], engine, lights, alarm, doors, bonnet, boot, objective);
if(doors == 1)
{
GameTextForPlayer(playerid, "~r~Vehicle Locked!", 5000, 5);
return 1;
}
return 1;
}