SA-MP Forums Archive
help do not use commands in event - 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)
+--- Thread: help do not use commands in event (/showthread.php?tid=653989)



help do not use commands in event - nbx2000 - 18.05.2018

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;
}



Re: help do not use commands in event - kovac - 18.05.2018

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?


Re: help do not use commands in event - nbx2000 - 18.05.2018

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


Re: help do not use commands in event - kovac - 18.05.2018

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


Re: help do not use commands in event - nbx2000 - 18.05.2018

IT PROVES IT AND NO COMMANDS OF THE GAMEMODE


Re: help do not use commands in event - kovac - 18.05.2018

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


Re: help do not use commands in event - nbx2000 - 18.05.2018

ahora no anda ningun comandos de todos del server


Re: help do not use commands in event - kovac - 18.05.2018

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?


Re: help do not use commands in event - dani18 - 19.05.2018

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


Re: help do not use commands in event - JasonRiggs - 19.05.2018

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;