їAlguno sabe como crear comandos con "Espacios"?
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{

    if(strcmp(cmdtext, "/comando", true) == 0)
    {
        new opcion[10];
        new idx;
        opcion = strtok(cmdtext, idx);

        if(!strlen(opcion))
        {
            SendClientMessage(playerid, -1, "Escribe: /comando (1-5) ");
            return true;
        }
        if(strcmp(opcion, "1", true) == 0)
        {
        //TU FUNCION
        }
        if(strcmp(opcion, "2", true) == 0)
        {
        //TU FUNCION
        }
        if(strcmp(opcion, "3", true) == 0)
        {
        //TU FUNCION
        }
        if(strcmp(opcion, "4", true) == 0)
        {
        //TU FUNCION
        }
        if(strcmp(opcion, "5", true) == 0)
        {
        //TU FUNCION
        }
    }
   
    return false;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)