Posts: 136
Threads: 40
Joined: Sep 2011
Reputation:
0
i need help
so: i want do all huntleys can be drived just by admin [rcon] a
and Mafia Boss Skin can be used just by admin [rcon]
when i logged in rcon all cars will not take damage for me
Max_Coldheart
Unregistered
pawn Код:
OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(!ispassenger)
{
if(vehicleid == 579)
{
if(!IsPlayerAdmin(playerid)
{
SendClientMessage(playerid, -1, "Huntley can be driven only by admin.");
ClearAnimations(playerid);
return 1;
}
}
}
}
Max_Coldheart
Unregistered
Quote:
Originally Posted by Kingunit
You forget the else with RemovePlayerFromVehicle.
|
RemovePlayerFromVehicle wouldn't work in this callback, as this is called right away when player presses enter near a vehicle (at least it used to be called then), so you have to clear the entering animation, and the player can't enter.
Max_Coldheart
Unregistered
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(ispassenger == 0)
{
if(vehicleid == 579)
{
if(!IsPlayerAdmin(playerid)
{
SendClientMessage(playerid, -1, "Huntley can be driven only by admin.");
ClearAnimations(playerid);
}
}
}
return 1;
}
Max_Coldheart
Unregistered
Quote:
Originally Posted by Kingunit
Then you can better use OnPlayerKeyStateChange
|
Yes, but I don't know how to actually use that (I'm not pretty good in that area), so I dislike using it