23.08.2015, 14:42
is there any filterscript that can stop teleport to avoid death
because i have a dm server and people can teleport to avoid death.
because i have a dm server and people can teleport to avoid death.
public OnPlayerUpdate(playerid)
{
if(GetPlayerHealth(playerid) < 50);
AllowPlayerTeleport( playerid, 0 );
SendClientMessage(playerid, -1, "You cannot teleport anymore!");
return 1;
}
#include a_samp
#include zcmd
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
SetPVarInt(playerid,"notp",1);
SetTimerEx( "notp", 10000, false, "i",playerid);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
SetPVarInt(playerid,"notp",0);
return 1;
}
CMD:sfa(playerid,params[]){
if(GetPVarInt(playerid, "notp") == 1) SendClientMessage(playerid,-1,"ERROR: You can't tp at this moment");
else if(GetPVarInt(playerid, "notp") == 0) {
SetPlayerPos(playerid, -1657.5400,-164.9457,14.1484);
}
return 1;
}
forward notp(playerid);
public notp(playerid)
{
SetPVarInt(playerid,"notp",0);
return 1;
}
hope you like this example:
PHP код:
|