[Ayuda] Con comando (parametros)
#1

Saludos, alguien me puede decir y corregir porque este comando no me sirve? Cuando intento usar el comando no me sale nada.. solo si uso /vender crack me sale "Uso: /vender crack [id] [cantidad] [precio]" pero si pongo la cantidad y el precio no me sale nada ni un mensaje, ni al otro jugador.. espero y me puedan ayudar.

pawn Код:
CMD:vender(playerid, params[])
{
    new string2[128];
    new msg[128];
    new cmdid;
    new cantidad;
    new precio;
    new string[128];
    new name[24];
    GetPlayerName(playerid, name, 24);

    if(isnull(params))
    {
        return SendClientMessage(playerid, -1, "Uso: /vender [crack]");
    }

    if(!strcmp(params, "crack", true))
    {
            if(sscanf(params, "s[20]ud[10]d[10]", params, cmdid,cantidad,precio)) return SendClientMessage(playerid,-1,"Uso: /vender crack [id] [cantidad] [precio]");
            if(cmdid == playerid) return SendClientMessage(playerid,-1,"No puedes venderte a ti mismo.");
            if(IsPlayerNPC(cmdid)) return SendClientMessage(playerid, COLOR_ROJO, "Esa id es de un NPC!");
            if(!IsPlayerConnected(cmdid) || cmdid == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"ID Invalido.");
            new Float:Pos[3];
            GetPlayerPos(cmdid, Pos[0], Pos[1], Pos[2]);
            if(!IsPlayerInRangeOfPoint(playerid, 6.0, Pos[0], Pos[1], Pos[2])) return SendClientMessage(playerid,-1,"Esta persona esta muy lejos.");
            if(Informacion[playerid][Crack] < cantidad) return SendClientMessage(playerid,-1,"No tienes suficiente crack para vender");
            if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,-1,"Necesitas estar afuera del vehiculo.");
            new oname[MAX_PLAYER_NAME];
            GetPlayerName(cmdid, oname, sizeof(oname));
        {
            format(msg, sizeof(msg), "Le as ofrecido %i gramo(s) de crack a %s por el precio de $%i.",cantidad,oname,precio);
                    print(string);
            Teofrecieron[cmdid] = 1;
            SetPVarInt(cmdid, "Persona", playerid);
            SetPVarInt(cmdid, "Cantidad", cantidad);
            SetPVarInt(cmdid, "Precio", precio);
            format(string2, sizeof(string2), "%s te a ofrecido %i gramo(s) de crack por $%i. Usa /aceptar crack si aceptas.", name,cantidad,precio);
        }
        SendClientMessage(playerid,-1, msg);
        SendClientMessage(cmdid,-1, string2);
}

    return 1;
}
Gracias de antemano.
Reply


Messages In This Thread
[Ayuda] Con comando (parametros) - by JGomez97 - 17.05.2015, 19:37
Re: [Ayuda] Con comando (parametros) - by SickAttack - 17.05.2015, 21:32
Re: [Ayuda] Con comando (parametros) - by JGomez97 - 17.05.2015, 21:56
Re: [Ayuda] Con comando (parametros) - by SickAttack - 17.05.2015, 22:01
Re: [Ayuda] Con comando (parametros) - by JGomez97 - 17.05.2015, 22:07
Respuesta: [Ayuda] Con comando (parametros) - by Darken3 - 17.05.2015, 22:14

Forum Jump:


Users browsing this thread: 1 Guest(s)