anti teamjack - 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 teamjack (
/showthread.php?tid=259168)
anti teamjack -
geerdinho8 - 03.06.2011
when pressing G it also kills the person.
Help pl0x?
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
for(new i; i < GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInVehicle(i,vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER && GetPlayerTeam(i) == GetPlayerTeam(playerid))
{
SetPlayerHeatlh(playerid, 0);
}
}
}
return 1;
}
Re: anti teamjack -
Mauzen - 03.06.2011
The ispassenger parameter can be used for that.
pawn Код:
if (ispassenger) return 1; // At the beginning of the function
Re: anti teamjack -
geerdinho8 - 03.06.2011
Thanks, it worked (Y)