Anti Team Jack!
#1

Hi guys!

I would like to know how to create anti team jack, and if the player does jack, then his health would be set to 0...

I know I would have to use SetPlayerHealth(playerid,0);
But what else should i use, and where should i put it??

Plz help me with this, cuz otherwise, my whole script is pointless(sort of).


Note: I already have my teams defined...
Reply
#2

OnVehicleEnter, loop GetPlayerVehicleID, GetPlayerVehicleSeat, SetPlayerHealth
Reply
#3

Sorry, but can someone explain it in a easier way? Im a new to scripting


Ive done this so far, plz can someone tell me how to modify it?

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(Car)
    {
      SendClientMessage(playerid,COLOR_ORANGE,"Server: You have the car, take it back to base");
      new pname[MAX_PLAYER_NAME];
      new string[128];
        GetPlayerName(playerid,pname,sizeof(pname));
        format(string,sizeof(string),"Server: %s (id:%d) has the car and is now bringing it back!",pname,playerid);
        SendClientMessageToAll(COLOR_ORANGE,string);
    }
    return 1;
}
Reply
#4

<DELETE>
Reply
#5

Note: I want the function that is used in Mini-Missions so when u jack ur team mate, u die! plz help me plz plz plz!!!!
Reply
#6

BUMP
Reply
#7

pawn Код:
if(!ispassenger && IsDriverInVehicle(vehicleid))
{
    SetPlayerHealth(playerid, 0);
}
pawn Код:
IsDriverInVehicle(vehicleid)
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER) return 1;
    }
    return 0;
}
Reply
#8

That will stop jack altogether! I just wanna stop team jack!
Reply
#9

Quote:
Originally Posted by Tigerbeast11
That will stop jack altogether! I just wanna stop team jack!
Is it too hard for you to add 1 simple IF check to it?

I just gave you an example.
Reply
#10

Quote:
Originally Posted by MadeMan
Quote:
Originally Posted by Tigerbeast11
That will stop jack altogether! I just wanna stop team jack!
Is it too hard for you to add 1 simple IF check to it?

I just gave you an example.
Im new to scripting so I wouldnt know where to put the "if" :S

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)