whats wrong with this cmd -
best_killa - 05.08.2011
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(gTeam[playerid] == TEAM_ZOMBIE) {
SendClientMessage(playerid,ADMIN_RED,"Error: Zombies cant drive!!");
RemovePlayerFromVehicle(playerid,vehicleid);
return 1;
}
can anyone help me with this?
i kno im missing the action to eject the player but idk how to eject that player can you please help me?
Re: whats wrong with this cmd -
Kitten - 05.08.2011
i don't actually seen anything wrong in the server but i would actually use this code.
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(gTeam[playerid] == TEAM_ZOMBIE) {
if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == CARID)
{
SetPlayerHealth(playerid, 0);
DestroyVehicle(vehicleid);
}
}
}
return 1;
}
Re: whats wrong with this cmd -
best_killa - 05.08.2011
thnx kitten ur the best!!!
but will this eject the zombie?? cuz i saw setplayerheatlh 0
Re: whats wrong with this cmd - Emmet_ - 05.08.2011
Quote:
Originally Posted by Kitten
i don't actually seen anything wrong in the server but i would actually use this code.
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate) { if(gTeam[playerid] == TEAM_ZOMBIE) { if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT) { new vehicleid = GetPlayerVehicleID(playerid); if(GetVehicleModel(vehicleid) == CARID) { SetPlayerHealth(playerid, 0); DestroyVehicle(vehicleid); } } } return 1; }
|
He's ejecting the player, not killing and destroying the vehicle....
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(gTeam[playerid] == TEAM_ZOMBIE)
{
SendClientMessage(playerid,ADMIN_RED,"Error: Zombies cant drive!!");
ClearAnimations(playerid);
return 1;
}
}
OnPlayerEnterVehicle is called as soon the player presses F near a vehicle. So if you use ClearAnimations, it will NEVER let him enter.
Re: whats wrong with this cmd -
Adil - 05.08.2011
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_PASSENGER || newstate == PLAYER_STATE_DRIVER)
{
if(gTeam[playerid] == TEAM_ZOMBIE)
{
SendClientMessage(playerid,ADMIN_RED,"Error: Zombies cant drive!!");
RemovePlayerFromVehicle(playerid,vehicleid);
return 1;
}
}
return 1;
}
Re: whats wrong with this cmd -
best_killa - 05.08.2011
thak you 69playa this actually worked just what i needed thnx!!
Re: whats wrong with this cmd -
windartist - 06.08.2011
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(gTeam[playerid] == TEAM_ZOMBIE) {
if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == CARID)
{
GameTextForPlayer(playerid,"Zombie's Cant Drive Cuz You Have No Lisence ||HaHA",1000,4);
RemovePlayerFromVehicle(playerid);
}
}
}
return 1;
}
This Is Correct Code LoL
Re: whats wrong with this cmd - suhrab_mujeeb - 06.08.2011
Quote:
Originally Posted by best_killa
thnx kitten ur the best!!! but will this eject the zombie?? cuz i saw setplayerheatlh 0
|
btw i think u are using his zombie script