23.09.2012, 04:43
Hello
I am trying to do something like only admins can get into vehicle id 432 and if players go in get slapped.I did this and its not working
I am trying to do something like only admins can get into vehicle id 432 and if players go in get slapped.I did this and its not working
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(PlayerInfo[playerid][Level] >= 0)
{
if(vehicleid == ANTIVEH)
{
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;
}
Код:
#define ANTIVEH 432