No commands on virtual world
#1

What can I do so that if a player is on virtual wolrd 6 and/or 10 he can't use any command. ONLY can use this one
pawn Код:
if(strcmp(cmd, "/ayudasancion", true) == 0)
    {
        SendClientMessage(playerid,-1, "{FF3300}Ayuda sobre tu sancion{FFFFFF}:");
        SendClientMessage(playerid,-1, "Usted fue sancionado por un Administrador. Esto pudo haber sido por incumplir nuestras reglas");
        SendClientMessage(playerid,-1, "luego de haber sido advertido, usar cheats, hacer spam, hacer flood, exet. ({DBED15}/reglas{FFFFFF})");
        SendClientMessage(playerid,-1, "Si crees que esto es una equivocaciуn informa de inmediato a un Admin. O bien puedes reportar al");
        SendClientMessage(playerid,-1, "administrador en nuestro foro si te ha hecho esto en repetidas ocasiones sin ninguna razуn valida.");
        SendClientMessage(playerid,-1, "Si llevas mas de 5 minutos aquн tienes derecho a pedir tu libertad, diciendo le a un administrador");
        SendClientMessage(playerid,-1, "que te libere. No podrбs usar comandos a partir de ahora.");
        return 1;
    }
if is on VW 6
Reply
#2

There is really no good way to do this by processing the commands inside of OnPlayerCommandText. I suppose you could check if they are in that desired virtual world at the top, and then make that command available to them, otherwise return something to notify them:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(GetPlayerVirtualWorld(playerid) == 6)
    {
        if(strcmp(cmd, "/ayudasancion", true) == 0)
        {
            // code
        }
        else return SendClientMessage(playerid, -1, "You can only use /ayudasancion inside of your current VW.");
    }
    // rest of the commands
}
Reply
#3

Alternatively if you use YCMD/ZCMD, you could probably do something like..

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if( strcmp( cmdtext, "ayudasancion", false ) == 0 )
    {
        return true;
    }
    else
    {
        if( GetPlayerVirtualWorld ( playerid ) == 6 )
            return false;
    }
    return true;
}
It compiles, not sure if it works, but it should.
Reply
#4

Quote:
Originally Posted by Bakr
Посмотреть сообщение
There is really no good way to do this by processing the commands inside of OnPlayerCommandText. I suppose you could check if they are in that desired virtual world at the top, and then make that command available to them, otherwise return something to notify them:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(GetPlayerVirtualWorld(playerid) == 6)
    {
        if(strcmp(cmd, "/ayudasancion", true) == 0)
        {
            // code
        }
        else return SendClientMessage(playerid, -1, "You can only use /ayudasancion inside of your current VW.");
    }
    // rest of the commands
}
Not working. it doesn't compile
Reply
#5

How is that information any use to me?
Reply
#6

Quote:
Originally Posted by Bakr
Посмотреть сообщение
How is that information any use to me?
What?
Reply
#7

You tell me it doesn't compile and then don't give me any other information. I'm not a wizard (by definition).
Reply
#8

Quote:
Originally Posted by Bakr
Посмотреть сообщение
You tell me it doesn't compile and then don't give me any other information. I'm not a wizard (by definition).
well nothing appears on the compiler box... what other info can I give you?
Reply
#9

Saying that much is more helpful than saying it simply doesn't work.

Paste your OnPlayerCommandText callback (after you can confirm that is what is causing the compiler to crash).
Reply
#10

PHP код:
if(strcmp(cmd"/ayudasancion"true) == 0)
{
        if(
GetPlayerVirtualWorld(playerid) == || GetPlayerVirtualWorld(playerid) == 6
        {
              
SendClientMessage(playerid,-1"{FF3300}Ayuda sobre tu sancion{FFFFFF}:");
                
SendClientMessage(playerid,-1"Usted fue sancionado por un Administrador. Esto pudo haber sido por incumplir nuestras reglas");
                
SendClientMessage(playerid,-1"luego de haber sido advertido, usar cheats, hacer spam, hacer flood, exet. ({DBED15}/reglas{FFFFFF})");
                
SendClientMessage(playerid,-1"Si crees que esto es una equivocaciуn informa de inmediato a un Admin. O bien puedes reportar al");
                
SendClientMessage(playerid,-1"administrador en nuestro foro si te ha hecho esto en repetidas ocasiones sin ninguna razуn valida.");
             
SendClientMessage(playerid,-1"Si llevas mas de 5 minutos aquн tienes derecho a pedir tu libertad, diciendo le a un administrador");
             
SendClientMessage(playerid,-1"que te libere. No podrбs usar comandos a partir de ahora.");
             return 
1;
        }
        else
        {
         
SendClientMessage(playerid,-1,"You are not in vw 6 or 10")
         }
         return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)