teleport to avoid death
#1

is there any filterscript that can stop teleport to avoid death

because i have a dm server and people can teleport to avoid death.
Reply
#2

Try this:

PHP код:
public OnPlayerUpdate(playerid)
{
    if(
GetPlayerHealth(playerid) < 50);        
    
AllowPlayerTeleportplayerid); 
    
SendClientMessage(playerid, -1"You cannot teleport anymore!");
    return 
1;

Do you have a /go command as well?
Reply
#3

This function is deprecated.
Reply
#4

hope you like this example:
PHP код:
#include a_samp
#include zcmd
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
SetPVarInt(playerid,"notp",1);
SetTimerEx"notp"10000false"i",playerid);
return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
SetPVarInt(playerid,"notp",0);
return 
1;
}
CMD:sfa(playerid,params[]){
    if(
GetPVarInt(playerid"notp") == 1SendClientMessage(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;

Reply
#5

Quote:
Originally Posted by jlalt
Посмотреть сообщение
hope you like this example:
PHP код:
#include a_samp
#include zcmd
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
SetPVarInt(playerid,"notp",1);
SetTimerEx"notp"10000false"i",playerid);
return 
1;
}
CMD:sfa(playerid,params[]){
    if(
GetPVarInt(playerid"notp") == 1SendClientMessage(playerid,-1,"ERROR: You can't tp at this moment");
    
SetPlayerPos(playerid, -1657.5400,-164.9457,14.1484);
    return 
1;
}
forward notp(playerid);
public 
notp(playerid)
{
SetPVarInt(playerid,"notp",0);
return 
1;

Gets shot lots of times. (eg. MG) that will trigger the timer many times. Bad way sonny.
Reply
#6

Quote:
Originally Posted by Jamester
Посмотреть сообщение
Gets shot lots of times. (eg. MG) that will trigger the timer many times. Bad way sonny.
alrady tested and you wrong mate.
Reply
#7

Quote:
Originally Posted by jlalt
Посмотреть сообщение
alrady tested and you wrong mate.
Nope, it clearly says when player gets hurt set this timer. You have no check that if the timer is already active.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)