24.03.2010, 22:09
Try this
pawn Код:
new Frozen[MAX_PLAYERS];
forward Freeze();
public OnPlayerConnect(playerid)
{
Frozen[playerid] = 0;
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(ispassenger) return 0;
if(vehicleid == WHATEVER)
{
new PlayerName[MAX_PLAYER_NAME] = GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
if(!strcmp(PlayerName, "YouName", true))
{
SetTimer("Freeze",5,false); TogglePlayerControllable(playerid, 0);
Frozen[playerid] = 1;
} else return 0;
}
return 1;
}
public Freeze()
{
for(new i; i<MAX_PLAYERS; i++)
{
if(Frozen[i] == 1)
{
TogglePlayerControllable(i, 1);
SendClientMessage(i, 0xFFFFFFAA," You are not the owner of this vehicle!");
}
}
return 1;
}