How to Create cmd /Reloadallhouse
#1

hey.. guys, i need help for cmd /reloadallhouse.
I was exhausted having to reload all the houses one by one armpit server restarts, I need help to be able to reload all home at once.
thanks...


PHP код:
CMD:reloadhouse(playeridparams[])
{
    if(
pAdmin[playerid] < 8)
        return 
Error(playerid"You are not authorized to use this command!");
    new 
h;
    new 
labeltext[300];
    if(
sscanf(params"d"h)) return ShowInfoBoxEx(playeridCOLOR_SYSTEME_CMD_USAGE_RELOADHOUSE);
    
DestroyHouseEntrance(hTYPE_OUT);
    
DestroyDynamicMapIcon(HouseMIcon[h]);
    
DestroyDynamic3DTextLabel(HouseLabel[h]);
    
    if(!
strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAMECASE_SENSETIVE))
    {
        
format(labeltextsizeof(labeltext), LABELTEXT1hInfo[h][HouseName], ToCurrency(hInfo[h][HouseValue]), h);
        
HouseMIcon[h] = CreateDynamicMapIcon(hInfo[h][CPOutX], hInfo[h][CPOutY], hInfo[h][CPOutZ], 31, -1, -1, -1, -1MICON_VD);
    }
    else if(
strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAMECASE_SENSETIVE))
    {
        
format(labeltextsizeof(labeltext), LABELTEXT2hInfo[h][HouseName], hInfo[h][HouseOwner], ToCurrency(hInfo[h][HouseValue]), Answer(hInfo[h][HousePrivacy], "Open""Closed"), h);
        
HouseMIcon[h] = CreateDynamicMapIcon(hInfo[h][CPOutX], hInfo[h][CPOutY], hInfo[h][CPOutZ], 32, -1, -1, -1, -1MICON_VD);
    }
    
HouseLabel[h] = CreateDynamic3DTextLabel(labeltextCOLOR_GREENhInfo[h][CPOutX], hInfo[h][CPOutY], hInfo[h][CPOutZ]+0.7TEXTLABEL_DISTANCE, .testlos 1);
    
HousePickupOut[h] = CreateDynamicPickup(PICKUP_MODEL_OUTPICKUP_TYPEhInfo[h][CPOutX], hInfo[h][CPOutY], hInfo[h][CPOutZ], -1, -1, -130.0);
    
ShowInfoBox(playeridI_H_RELOADEDh);
    return 
1;
}
stock Float:GetPosInFrontOfPlayer(playerid, &Float:x, &Float:yFloat:distance)
{
    new 
Float:a;
    
GetPlayerPos(playeridxya);
    switch(
IsPlayerInAnyVehicle(playerid))
    {
        case 
0GetPlayerFacingAngle(playerida);
        case 
1GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }
    
+= (distance floatsin(-adegrees));
    
+= (distance floatcos(-adegrees));
    return 
a;
}
stock LoadHouses()
{
    
mysql_function_query(g_SQL_handle"SELECT int_name,intx,inty,intz,inta,cpx,cpy,cpz,interior,value FROM interiors"true"LoadHouseInteriorData""");
    
mysql_function_query(g_SQL_handle"SELECT house_id,hname,howner,hlocation,hpass,x,y,z,a,cpx,cpy,cpz,hvalue,hstorage,hint,hprivacy,hforsale FROM houses ORDER BY house_id"true"LoadHouseData""");
}
function 
LoadHouseInteriorData()
{
    new 
hintresultline[400];
    
mysql_store_result();
    while(
mysql_fetch_row_format(resultline))
    {
        
sscanf(resultline"p<|>s[30]fffffffii",
            
hIntInfo[hint][IntName],
            
hIntInfo[hint][IntSpawnX],
            
hIntInfo[hint][IntSpawnY],
            
hIntInfo[hint][IntSpawnZ],
            
hIntInfo[hint][IntSpawnAngle],
            
hIntInfo[hint][IntCPX],
            
hIntInfo[hint][IntCPY],
            
hIntInfo[hint][IntCPZ],
            
hIntInfo[hint][IntInterior],
            
hIntInfo[hint][IntValue]);
        
hint++;
    }
    
mysql_free_result();
    return 
1;
}
stock UnloadHouses()
{
    foreach(
Housesh)
    {
        
DestroyHouseEntrance(hTYPE_OUT);
        
DestroyHouseEntrance(hTYPE_INT);
        
DestroyDynamicMapIcon(HouseMIcon[h]);
        
DestroyDynamic3DTextLabel(HouseLabel[h]);
    }
    
Iter_Clear(Houses);
    return 
1;

Reply


Messages In This Thread
How to Create cmd /Reloadallhouse - by DandyCorleone - 07.11.2016, 15:03
Re: How to Create cmd /Reloadallhouse - by DandyCorleone - 07.11.2016, 15:09
Re: How to Create cmd /Reloadallhouse - by PeanutButter - 07.11.2016, 16:19
Re: How to Create cmd /Reloadallhouse - by Mencent - 07.11.2016, 16:31

Forum Jump:


Users browsing this thread: 1 Guest(s)