23.09.2012, 04:58
TRY THIS
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid) {
for(new x=0; x<MAX_PLAYERS; x++) {
if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && PlayerInfo[x][SpecID] == playerid) {
TogglePlayerSpectating(x, 1);
PlayerSpectateVehicle(x, vehicleid);
PlayerInfo[x][SpecType] = ADMIN_SPEC_TYPE_VEHICLE;
}
}
if(vehicleid == ANTIVEH)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][Level] >= 0)
{
SendClientMessage(playerid, COLOR_GREEN, "Welcome Admin in Admin Restricted Vehicle.");
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "balnh.");
new Float:Health, Float:x, Float:y, Float:z; GetPlayerHealth(playerid,Health); SetPlayerHealth(playerid,Health-25);
GetPlayerPos(playerid,x,y,z); SetPlayerPos(playerid,x,y,z+5); PlayerPlaySound(playerid,1190,0.0,0.0,0.0); PlayerPlaySound(playerid,1190,0.0,0.0,0.0);
}
}
}
return 1;
}