їCуmo hacer un comando de 3 opciones?
#8

Pruebalo asн

PHP код:
CMD:editarnegocio(playeridparams[])
{
    new 
opcion[24], string[40];
    if(
sscanf(params"s[24]S()[40]"opcion)) return SendClientMessage(playerid, -1"/editarnegocio opciуn");
    if(!
strcmp(opcion"Precio"true))
    {
        new 
preciostring[128];
        if(
sscanf(string"d"precio)) return SendClientMessage(playerid, -1"/editarnegocio precio nuevo precio");
        if(
precio 50000 || precio 10000000) return SendClientMessage(playerid, -1"Error, el precio debe ser entre 50000 y 10000000");
        for(new 
0sizeof(NegocioInfo); ++)
        {
            if(
IsPlayerInRangeOfPoint(playerid5.0NegocioInfo[i][nPosX], NegocioInfo[i][nPosY], NegocioInfo[i][nPosZ]))
            {
                
NegocioInfo[i][nPrecio] = precio;
                
GuardarNegocio(i);
                
ActualizarTextoNegocio(i);
                
format(stringsizeof(string), "Administraciуn: %s le cambiу el interior al negocio %d."NombreJugador(playerid), NegocioInfo[i][nSQLID]);
                
SendStaffMessage(COLOR_STAFFstring);
                return 
1;
            }
        }
        
SendClientMessage(playeridCOLOR_ROJO"No estбs cerca de ningъn negocio.");
    }
    else if(!
strcmp(opcion"Otra"true))
    {
    }
    return 
1;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)