SA-MP Forums Archive
No commands on virtual world - 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: No commands on virtual world (/showthread.php?tid=419464)



No commands on virtual world - RiChArD_A - 01.03.2013

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


Re: No commands on virtual world - Bakr - 01.03.2013

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
}



Re: No commands on virtual world - 2KY - 01.03.2013

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.


Respuesta: Re: No commands on virtual world - RiChArD_A - 01.03.2013

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


Re: No commands on virtual world - Bakr - 01.03.2013

How is that information any use to me?


Respuesta: Re: No commands on virtual world - RiChArD_A - 01.03.2013

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


Re: No commands on virtual world - Bakr - 01.03.2013

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


Respuesta: Re: No commands on virtual world - RiChArD_A - 01.03.2013

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?


Re: No commands on virtual world - Bakr - 01.03.2013

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).


Re: No commands on virtual world - Kenway - 01.03.2013

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;