______|Anti Car Kill ? | Rep + |________
#1

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,
Reply
#2

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;
}
Reply
#3

Is That even possible?
Reply
#4

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 ..
Reply
#5

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;
}
Reply
#6

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.
Reply
#7

dude that already helped him and he even repped me already..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)