24.01.2015, 05:10
pawn Код:
#include <a_samp>
new NO_Repetir[MAX_PLAYERS];
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ){
if(playerid != INVALID_PLAYER_ID){
if(hittype==BULLET_HIT_TYPE_PLAYER){
#define SEGUNDO_NO_REPETIR ( 30 ) //30 segundos
if( NO_Repetir[playerid] < gettime() ){
NO_Repetir[playerid] = gettime() + SEGUNDO_NO_REPETIR;
// tu funcion
}
}
}
return true;
}
pawn Код:
#include <a_samp>
#include <SetTimerCMD_V3>
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ){
if(playerid != INVALID_PLAYER_ID){
if(hittype==BULLET_HIT_TYPE_PLAYER){
#define SEGUNDO_NO_REPETIR ( 30 ) //30 segundos
#define SLOT_FUNCTION ( 0 )
if( !GetTimerCMD(playerid,SLOT_FUNCTION) ){
SetTimerCMD(playerid,SLOT_FUNCTION,SEGUNDO_NO_REPETIR);
// tu funcion
}
}
}
return true;
}