Invalid Command -,-
#1

hi all, i got this script.(i made it by myself, that's why it's always bugged. becouse when i make a script, it's always bugged XD)
pawn Код:
CMD:lveh(playerid,params[])
{
    new Query[128];
    new rows,fields;
    new Float:nx,Float:ny,Float:nz,Float:nrot;
    new savestr[10], ID, Model, col1, col2, comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, pj;
    mysql_format(dbHandle,Query,sizeof Query,"SELECT * FROM `SavedVeh` WHERE `Name` = '%s'",pName(playerid));
    mysql_query(dbHandle,Query);
    cache_get_data(rows,fields);
    if(rows)
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new vid = GetPlayerVehicleID(playerid);
            if(vid) DestroyVehicle(vid);
        }
        GetPlayerPos(playerid, nx, ny, nz);
        GetPlayerFacingAngle(playerid, nrot);
        if(pInfo[playerid][pSpawnVehicle] != INVALID_VEHICLE_ID)
        {
            DestroyVehicle(pInfo[playerid][pSpawnVehicle]);
            pInfo[playerid][pSpawnVehicle] = INVALID_VEHICLE_ID;
        }
        cache_get_field_content(0,"ID", savestr); ID = strval(savestr);
        if(SavedVeh[ID] != INVALID_VEHICLE_ID)
        {
            DestroyVehicle(SavedVeh[ID]);
            SavedVeh[ID] = INVALID_VEHICLE_ID;
        }
        Model = cache_get_field_content_int(0,"Model");
        col1 = cache_get_field_content_int(0,"Col1");
        col2 = cache_get_field_content_int(0,"Col2");
        comp1 = cache_get_field_content_int(0,"1");
        comp2 = cache_get_field_content_int(0,"2");
        comp3 = cache_get_field_content_int(0,"3");
        comp4 = cache_get_field_content_int(0,"4");
        comp5 = cache_get_field_content_int(0,"5");
        comp6 = cache_get_field_content_int(0,"6");
        comp7 = cache_get_field_content_int(0,"7");
        comp8 = cache_get_field_content_int(0,"8");
        comp9 = cache_get_field_content_int(0,"9");
        pj = cache_get_field_content_int(0,"PJ");
        pInfo[playerid][pSpawnVehicle]=CreateVehicle(Model, nx, ny, nz, nrot, col1, col2, -1);
        AddVehicleComponent(pInfo[playerid][pSpawnVehicle], comp1);
        AddVehicleComponent(pInfo[playerid][pSpawnVehicle], comp2);
        AddVehicleComponent(pInfo[playerid][pSpawnVehicle], comp3);
        AddVehicleComponent(pInfo[playerid][pSpawnVehicle], comp4);
        AddVehicleComponent(pInfo[playerid][pSpawnVehicle], comp5);
        AddVehicleComponent(pInfo[playerid][pSpawnVehicle], comp6);
        AddVehicleComponent(pInfo[playerid][pSpawnVehicle], comp7);
        AddVehicleComponent(pInfo[playerid][pSpawnVehicle], comp8);
        AddVehicleComponent(pInfo[playerid][pSpawnVehicle], comp9);
        ChangeVehiclePaintjob(pInfo[playerid][pSpawnVehicle], pj);
        PutPlayerInVehicle(playerid, pInfo[playerid][pSpawnVehicle], 0);
        arendaveh[pInfo[playerid][pSpawnVehicle]] = playerid;
        isarenda[pInfo[playerid][pSpawnVehicle]] = 1;
    }
    else if(!rows)
    {
        SendClientMessageLang(playerid, 0xFF0000FF, ""Err" You don't have a saved vehicle!", ""Err" Anda tidak memiliki kendaraan pribadi.");
    }
    return 1;
}
when i use this command, the saved vehicle is spawned, but it's give me a message that my command is invalid -_-
what's wrong?

EDIT:

ah nevermind -,- there are nobody trying to help me. and i already fix it -,-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)