Anti Team Jack! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Anti Team Jack! (
/showthread.php?tid=106623)
Anti Team Jack! -
Tigerbeast11 - 04.11.2009
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...
Re: Anti Team Jack! -
Sergei - 04.11.2009
OnVehicleEnter, loop GetPlayerVehicleID, GetPlayerVehicleSeat, SetPlayerHealth
Re: Anti Team Jack! -
Tigerbeast11 - 04.11.2009
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;
}
Re: Anti Team Jack! -
Tigerbeast11 - 04.11.2009
<DELETE>
Re: Anti Team Jack! -
Tigerbeast11 - 04.11.2009
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!!!!
Re: Anti Team Jack! -
Tigerbeast11 - 04.11.2009
BUMP
Re: Anti Team Jack! -
MadeMan - 04.11.2009
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;
}
Re: Anti Team Jack! -
Tigerbeast11 - 04.11.2009
That will stop jack altogether! I just wanna stop team jack!
Re: Anti Team Jack! -
MadeMan - 04.11.2009
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.
Re: Anti Team Jack! -
Tigerbeast11 - 04.11.2009
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