public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { new vhid = GetPlayerVehicleID(playerid); if(vhid == 411 && sInfo[playerid][admin] < 1) { SendClientMessage(playerid, -1, "This car is for ADMINS!"); RemovePlayerFromVehicle(playerid); } return 1; }
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { new vhid = GetPlayerVehicleID(playerid); if(vhid == 411 && sInfo[playerid][admin] < 1) { SendClientMessage(playerid, -1, "This car is for ADMINS!"); RemovePlayerFromVehicle(playerid); } return 1; }
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(vehicleid == 411 && sInfo[playerid][admin] < 1) { SendClientMessage(playerid, -1, "This car is for ADMINS!"); RemovePlayerFromVehicle(playerid); } return 1; }
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(vhid == 411 && sInfo[playerid][admin] < 1)
{
SendClientMessage(playerid, -1, "This car is for ADMINS!");
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(vehicleid == 411 && sInfo[playerid][admin] < 1) { SendClientMessage(playerid, -1, "This car is for ADMINS!"); RemovePlayerFromVehicle(playerid); } return 1; } |
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { new vhid = GetPlayerVehicleID(playerid); if(vhid == 411 && sInfo[playerid][admin] < 1) { SendClientMessage(playerid, -1, "This car is for ADMINS!"); TogglePlayerControllable(playerid, 1); } return 1; }
Use OnPlayerStateChange :
pawn Код:
|
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
new model = GetVehicleModel(GetPlayerVehicleID(playerid));
if(model == 411 && sInfo[playerid][admin] < 1)
{
SendClientMessage(playerid, -1, "This car is for ADMINS!");
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}