______|Anti Car Kill ? | Rep + |________ -
Mr.Faqahat - 30.09.2012
Hello,
I am looking of a anti car kill for my server . Like when player got under a car he automatically move out of it ,
Will surely appreciate your help,
Re: ______|Anti Car Kill ? | Rep + |________ -
XtremeR - 30.09.2012
well thats not possible but u can surly punish the player
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new vehid = GetPlayerVehicleID(playerid); //Get's the vehicle ID
new string[128];
if(vehid > 487) //Mavetrick ID same to the Car Park's id in the death list
{
SetPlayerHealth(killerid, 0); //Set's the killer with the heli to "0"
GetPlayerName(playerid, string, sizeof(string));
format(string, sizeof(string), "Player %s has been punished - (REASON): Heli kill / Car Kill");
SendClientMessageToAll(0xFF2800FF, string); //Send's the message to all the players in the server
}
return 1;
}
or u can ask players to use /out
pawn Код:
CMD:out(playerid,paramx[]){
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid,x,y,z);
}
return 1;
}
Re: ______|Anti Car Kill ? | Rep + |________ -
Gangster-rocks - 30.09.2012
Is That even possible?
Re: ______|Anti Car Kill ? | Rep + |________ -
Mr.Faqahat - 30.09.2012
Quote:
Originally Posted by XtremeR
well thats not possible but u can surly punish the player
pawn Код:
public OnPlayerDeath(playerid, killerid, reason) { new vehid = GetPlayerVehicleID(playerid); //Get's the vehicle ID new string[128]; if(vehid > 487) //Mavetrick ID same to the Car Park's id in the death list { SetPlayerHealth(killerid, 0); //Set's the killer with the heli to "0" GetPlayerName(playerid, string, sizeof(string)); format(string, sizeof(string), "Player %s has been punished - (REASON): Heli kill / Car Kill"); SendClientMessageToAll(0xFF2800FF, string); //Send's the message to all the players in the server } return 1; }
or u can ask players to use /out
pawn Код:
CMD:out(playerid,paramx[]){ new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid,x,y,z); } return 1; }
|
How its not possible i my self saw in many many servers like When some one car park you the body automatically move away from the car ..
Re: ______|Anti Car Kill ? | Rep + |________ -
XtremeR - 30.09.2012
use this
pawn Код:
stock IsPlayerNearVehicle(playerid, vehicleid, Float:distance)
{
new m = GetVehicleModel(vehicleid);
if(m == 0) return 0;
new Float:x, Float:y, Float:z;
GetVehiclePos(vehicleid, x, y, z);
if(!IsPlayerInRangeOfPoint(playerid, distance, x, y, z)) return 0;
return 1;
}
pawn Код:
public OnPlayerUpdate(playerid)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerNearVehicle(playerid, vehicleid, Float:0.50)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid,x,y,z);
}
return 1;
}
Re: ______|Anti Car Kill ? | Rep + |________ -
CmZxC - 30.09.2012
I love how everyone is using outdated and advanced stuff, and not something obvious.
You can give it a try using OnPlayerTakeDamage, checking if the "weapon" is a car/heli kill.
Re: ______|Anti Car Kill ? | Rep + |________ -
XtremeR - 30.09.2012
dude that already helped him and he even repped me already..