їComo hago un cmd con varias opciones?
#3

pawn Код:
#include <a_samp> // => http://sa-mp.com/download.php
#include <zcmd> // => forum.sa-mp.com/showthread.php?t=91354
#include <sscanf2> // => https://sampforum.blast.hk/showthread.php?tid=120356
#include <YSI\y_stringhash> // => https://sampforum.blast.hk/showthread.php?tid=169354

COMMAND:ejemplo(playerid, params[]){
    new opciones[20];
    if(sscanf(params, "s[20]", opciones)) return SendClientMessage(playerid, -1, "escribe el comando /ejemplo [opciones (texto1-texto2-texto3-texto4)] ");
    switch (YHash(opciones)){
        case _H<texto1>:{//opcion 1
        //tu funcion...
        }
        case _H<texto2>:{//opcion 2
        //tu funcion...
        }
        case _H<texto3>:{//opcion 3
        //tu funcion...
        }
        case _H<texto4>:{//opcion 4
        //tu funcion...
        }
        default:{//ninguna opcion
        //tu funcion...
        }
    }
    return true;
}
Reply


Messages In This Thread
їComo hago un cmd con varias opciones? - by JeffreyG - 27.07.2014, 04:50
Respuesta: їComo hago un cmd con varias opciones? - by BecksLennon - 27.07.2014, 05:01
Respuesta: їComo hago un cmd con varias opciones? - by OTACON - 27.07.2014, 06:50
Re: Respuesta: їComo hago un cmd con varias opciones? - by zSuYaNw - 28.07.2014, 05:19

Forum Jump:


Users browsing this thread: 1 Guest(s)