SA-MP Forums Archive
Unknow command with Zcmd - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Unknow command with Zcmd (/showthread.php?tid=529548)



Unknow command with Zcmd - FullCircle - 02.08.2014

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?


Re: Unknow command with Zcmd - PrivatioBoni - 02.08.2014

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.


Respuesta: Re: Unknow command with Zcmd - FullCircle - 02.08.2014

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;
}



Respuesta: Unknow command with Zcmd - FullCircle - 02.08.2014

Solved