max objects
#1

Hi, how do I make system only spawn 5 prize at one time? I'm in new mysql so my sql code kinda messed up. I know I haven't declare a but Irray don't understand how to do it with sql

PHP код:
function:OnLoadHiddenGift()
{
    new 
rows cache_num_rows();
    if(
rows)
    {
        new 
sttr[128];
        for(new 
0rows!= li++)
        {
            
cache_get_field_content(i"hobj_posx"sttr); HiddenGift[i][hobj_posx] = floatstr(sttr);
            
cache_get_field_content(i"hobj_posy"sttr); HiddenGift[i][hobj_posy] = floatstr(sttr);
            
cache_get_field_content(i"hobj_posz"sttr); HiddenGift[i][hobj_posz] = floatstr(sttr);
        }
    }
    
SpawnHiddenGift(5);
    return 
1;

PHP код:
stock SpawnHiddenGift(hiddengift)
{
    for(new 
0hiddengifti++)
    {
        new 
hobj minrand(0MAX_HGIFTS);
        new 
hobj_i minrand(12);
        new 
hobj_obj 19054;
        if(
hobj_i == 1)
        {
            
hobj_obj 19054;
        }
        if(
hobj_i == 2)
        {
            
hobj_obj 19055;
        }
        
HiddenGift[hobj][hobj_spawn] = true;
        
HiddenGift[hobj][hobj_obj] = CreateDynamicObject(hobj_objHiddenGift[hobj][hobj_posx], HiddenGift[hobj][hobj_posy], HiddenGift[hobj][hobj_posz]-0.40.0,0.0,0.0,-1,-1,-1,300.0);
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)