Creating object from MySQL [+rep?]
#1

Previous question solved Thanks to Vince
Next:

Now trying to delete those objects/maps:

pawn Код:
CMD:delmaptest(playerid,params[])
{
    new query[256],mapname[64];
    if(sscanf(params,"s[64]",mapname)) return SendClientMessage(playerid, -1, "USAGE: /maptest [mapname]");
    format(query,sizeof query,"SELECT * FROM `Map_Submits` WHERE MapName = '%s'",mapname);
    mysql_query(query);
    mysql_store_result();
    if(!mysql_num_rows())
    {
        print("Map doesn't exist");
        SendClientMessage(playerid,-1,"Map doesn't exist !");
    }
    else
    {
        printf("Deleting objects and cars from map %s",mapname);
        for( new x=0; x < MAX_OBJECTS; x++)
        {
            DestroyObject(tempMapID[x]);
            tempMapID[x] = 0;
            printf("Deleting object: %i",tempMapID[x]);
        }
        SendClientMessage(playerid,-1,"Objects deleted");
        print("Objects deleted");
        for(new y=0;y<MAX_CARS;y++)
        {
            DestroyVehicle(tempCarID[y]);
            tempCarID[y] = 0;
            printf("Deleting car: %i",tempCarID[y]);
        }
        SendClientMessage(playerid,-1,"Cars deleted");
        print("Cars deleted");
    }
    return 1;
}
I can only create the vehicle once !
That means if i create the object/vehicles -> done
Delete object/vehicles -> done
Create's again objects/vehicles -> fail, it only loads the objects but not the cars.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)