Unknow command with Zcmd
#1

pawn Код:
CMD:crearobjeto(playerid, params[])
{
    new playerState = GetPlayerState(playerid), Modelo;
    new vehicleid = GetPlayerVehicleID(playerid);
    if(playerState != PLAYER_STATE_DRIVER || !IsPlayerInAnyVehicle(playerid)) return  SendClientMessage(playerid, -1, "{47D751}« ! » {FFFFFF}No estas en un vehiculo o no eres el conductor.");
    if(IsPlayerConnected(playerid))
    {
        if(sscanf(params, "i", Modelo)) return SendClientMessage(playerid, -1, "/crearobjeto <modelid>");
        new ObjetoID = GetFreeObjeto();
        ObjetoValido[ObjetoID] = true;
        Objetos[ObjetoID] = CreateDynamicObject(Modelo, 0, 0, 0, 0, 0, 0, 0, -1, -1, 200.0);
        AttachDynamicObjectToVehicle(ObjetoID, vehicleid, 0, 0, 0, 0, 0, 0);
    }
    return 1;
}
What's wrong?
Reply
#2

Well, you set something to true even though you didn't declare it at all, let alone as a bool(ean)?

But I would've thought it would bring up errors.
Reply
#3

Quote:
Originally Posted by PrivatioBoni
Посмотреть сообщение
Well, you set something to true even though you didn't declare it as a bool(ean)?

But I would've thought it would bring up errors.
No... No error... When I send the command, Doesn't work and appear the message of "SERVER:Unknow command"

Edit:
pawn Код:
#define MAX_OBJETOS                 50

new Objetos[MAX_OBJETOS];
new bool:ObjetoValido[MAX_OBJETOS];
stock GetFreeObjeto()
{
    for(new i = 0; i < sizeof(ObjetoValido); i ++)
    {
        if(!ObjetoValido[i]) return i;
    }
    return -1;
}
Reply
#4

Solved
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)