SA-MP Forums Archive
Need help with removehouse by id... - 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: Need help with removehouse by id... (/showthread.php?tid=421185)



Need help with removehouse by id... - Scrillex - 08.03.2013

Hello members of this forum help is needed as fire.. I don't know how to get this to work to remove it by id... Maybe some one can help me out
so here is my command

pawn Код:
YCMD:removehouse(playerid, params[], help)
{
    #pragma unused help
    #pragma unused params
    if(pInfo[playerid][Admin] < 1337) return 0;
    new h = GetClosetHouseID(playerid),file[32];
    if(h == -1) return SCM(playerid,COLOR_RED,"EROR: "COL_WHITE"There is no house.");
    format(file,32,House_File,h);
    if(fexist(file))
    {
        fremove(file);
        DestroyDynamicPickup(House[h][PickupU]);
        DestroyDynamic3DTextLabel(House[h][DLabel]);
        DestroyDynamicMapIcon(House[h][Icon]);
    }
    return 1;
}



Re: Need help with removehouse by id... - Jstylezzz - 08.03.2013

pawn Код:
YCMD:removehouseid(playerid, params[], help)
{
    #pragma unused help
    new hid;
    if(sscanf(params,"i",hid)) return SendClientMessage(playerid,-1,"Usage: /removehouseid [houseid]");
    if(pInfo[playerid][Admin] < 1337) return 0;
    new h = hid,file[32];
    if(h == -1) return SCM(playerid,COLOR_RED,"EROR: "COL_WHITE"There is no house with this id.");
    format(file,32,House_File,h);
    if(fexist(file))
    {
        fremove(file);
        DestroyDynamicPickup(House[h][PickupU]);
        DestroyDynamic3DTextLabel(House[h][DLabel]);
        DestroyDynamicMapIcon(House[h][Icon]);
    }
    return 1;
}
It would be something like this