help do not use commands in event
#1

hello how can I add a variable I do not command an example when they enter the event / ejoin no longer seems to use commands

Код:
CMD:event(playerid)
{
    if ( TheEvenT [ playerid ] == true ) return SendClientMessage ( playerid , 0x9FFF00FF , "{F81414}[ERROR]: You can not enter commands in event, type /ExitEvent out!" ) ;
    if ( !EvenTStats ) return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}[ERROR]: The event is not open." ) ;
    new Float:Health;
    GetPlayerHealth ( playerid , Health ) ;
    if ( Health < 30.0 ) return SendClientMessage ( playerid, 0xFF0000FF, "{F81414}[ERROR] You can not teleport with little life." ) ;
    TheEvenT [ playerid ] = true ;
    ResetPlayerWeapons ( playerid ) ;
    format ( iString2 , sizeof ( iString2 ) , "{FFFFFF}' %s ' {F81414}It was for the event {FFFFFF}( /EVENT )", GetPName ( playerid ) ) ;
    SendClientMessageToAll ( 0x88FF9FFF , iString2 ) ;
    SetPlayerPos ( playerid , EventoPos [ 0 ] , EventoPos [ 1 ] , EventoPos [ 2 ] ) ;
    SetPlayerFacingAngle ( playerid , EventoPos [ 3 ] ) ;
    SetPlayerInterior ( playerid , EventoInt ) ;
    SetPlayerVirtualWorld ( playerid , EventoVW ) ;
    return 1;
}
Reply
#2

I really can't understand you. Please use gooogle translator.
As I can see, you already do check if player is in event and if so, return error. What is wrong?
Reply
#3

as I can put a variable not commands in system events. for the player tipe ejoin do not use cmds
Reply
#4

I misunderstood, sorry.
To prevent every ZCMD command from being used in event, you can do this;
PHP код:
public OnPlayerCommandReceived(playeridcmdtext[])
{
    if(
TheEvenT[playerid]){
        
SendClientMessage(playeridCOLOR_RED"{F81414}[ERROR]: You can not enter commands in event, type /ExitEvent out!");
        return 
0;
    }
    return 
1;

PS: I suggest you to name the variable like IsInEvent[playerid] for ease of reference
Reply
#5

IT PROVES IT AND NO COMMANDS OF THE GAMEMODE
Reply
#6

I can't understand you, feel free to reply in your language
Reply
#7

ahora no anda ningun comandos de todos del server
Reply
#8

Quote:
Originally Posted by nbx2000
Посмотреть сообщение
ahora no anda ningun comandos de todos del server
Como dije, eso bloquea todos los comandos para el jugador que estб en el evento. їEntonces que quieres hacer?
Reply
#9

Quote:
Originally Posted by nbx2000
Посмотреть сообщение
ahora no anda ningun comandos de todos del server
Inglйs o espaсol? lol.
Reply
#10

prueba esto

PHP код:
public OnPlayerCommandReceived(playeridcmdtext[])
{
    if(
TheEvenT[playerid]){
        
SendClientMessage(playeridCOLOR_RED"{F81414}[ERROR]: You can not enter commands in event, type /ExitEvent out!");
        return 
0;
    }
    else if(!
TheEvenT[playerid]) return 1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)