In need of 2 codes :( CARPARK & HELIBLADE
#1

1st code needed is a anti-Heliblade code that kills the player who used a helicopter to kill other players & the code gives all players a message saying the killer was killed for killing another player if that makes sense. I'm using this code but its not working right.

if(reason == 50)
{
new str[752], pName[MAX_PLAYER_NAME];
GetPlayerName(killerid, pName, sizeof(pName));
SendClientMessageToAll(COLOR_RED, str);
format(string, sizeof(string), "%s (%d) has been killed for heli blade.", pName, playerid);
SetPlayerHealth(killerid,-1);

IM lost lol

The other code i need is like this:

if ( reason == 49 ) {
new kstring[128],
kickname[MAX_PLAYER_NAME],
String[50];
if ( IsPlayerConnected(killerid) ) {
GetPlayerName(killerid, kickname, sizeof(kickname));
format(String, 256, "AdmWarning: [%d] %s has just carparked a player.", killerid, kickname);
SendMessageToAdmins(String);
printf("%s", kstring);

But i don't need it to tell admins just send message to all players about this players punishment, DEATH would be a good thing maybe that will STOP CAR PARKING on my server.

Thanks for any and all help.
Reply
#2

You can use OnPlayerDeath(), and find if the killerid was in a vehicle, and in the driver seat, and the one killed was not in a vehicle at all. Then you can tell if he was car parked.

Same goes for heli, detect if he's in a vehicle, and get the vehicle ID for all helicopters. Check if the one killed was not in any vehicle, and boom. Hope this helps.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)