SA-MP Forums Archive
Transformation - 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: Transformation (/showthread.php?tid=664442)



Transformation - HypCosmin - 28.02.2019

Hello, is it possible to turn this into a command? Can you help me? Thank you!

PHP код:
public OnPlayerPickUpDynamicPickup(playeridpickupid)
{
    if(
GetPVarInt(playerid"HousePickupCooldown") < gettime())
    {
        if(
InHouse[playerid] == INVALID_HOUSE_ID) {
            foreach(new 
Houses)
            {
                
                if(
pickupid == HouseData[i][HousePickup])
                {
                    
SetPVarInt(playerid"HousePickupCooldown"gettime() + HOUSE_COOLDOWN);
                    
SetPVarInt(playerid"PickupHouseID"i);
                    
                    if(!
strcmp(HouseData[i][Owner], "-")) {
                        new 
string[256];
                        if(
PlayerInfo[playerid][pLevel] < 6) return    SCM(playeridCOLOR_GRAD1""Text");
                        format(string, sizeof(string), ""Text"
convertNumber(HouseData[i][Price]));
                        
ShowPlayerDialog(playeridDIALOG_BUY_HOUSEDIALOG_STYLE_MSGBOX""C_DIA"House"string"Buy""Close");
                    }else{
                        if(
HouseData[i][SalePrice] > && strcmp(HouseData[i][Owner], Player_GetName(playerid)))
                        {
                            new 
string[256];
                            if(
PlayerInfo[playerid][pLevel] < 6) return    SCM(playeridCOLOR_GRAD1"Text");
                            
format(stringsizeof(string), "Text"HouseData[i][Owner], convertNumber(HouseData[i][SalePrice]));
                            
ShowPlayerDialog(playeridDIALOG_BUY_HOUSE_FROM_OWNERDIALOG_STYLE_MSGBOX""C_DIA"House"string"Buy""Close");
                            return 
1;
                        }
                        
                        switch(
HouseData[i][LockMode])
                        {
                            case 
LOCK_MODE_NOLOCKSendToHouse(playeridi);
                            case 
LOCK_MODE_PASSWORDShowPlayerDialog(playeridDIALOG_HOUSE_PASSWORDDIALOG_STYLE_INPUT""C_DIA"House""Text""Done""Close");
                            case 
LOCK_MODE_KEYS:
                            {
                                new 
gotkeys Iter_Contains(HouseKeys[playerid], i);
                                if(!
gotkeys) if(!strcmp(HouseData[i][Owner], Player_GetName(playerid))) gotkeys 1;
                                if(
gotkeys) {
                                    
SendToHouse(playeridi);
                                }else{
                                    
SCM(playerid0xE74C3CFF"Text");
                                }
                            }
                            case 
LOCK_MODE_OWNER:
                            {
                                if(!
strcmp(HouseData[i][Owner], Player_GetName(playerid))) {
                                    
SetPVarInt(playerid"HousePickupCooldown"gettime() + HOUSE_COOLDOWN);
                                    
SendToHouse(playeridi);
                                }else{
                                    
SCM(playerid0xE74C3CFF"Text");
                                }
                            }
                        }
                    }
                    return 
1;
                }
            }
        }else{
            for(new 
isizeof(HouseInteriors); ++i)
            {
                if(
pickupid == HouseInteriors[i][intPickup])
                {
                    
SetPVarInt(playerid"HousePickupCooldown"gettime() + HOUSE_COOLDOWN);
                    
SetPlayerVirtualWorld(playerid0);
                    
SetPlayerInterior(playerid0);
                    
SetPlayerPos(playeridHouseDataInHouse[playerid] ][houseX], HouseDataInHouse[playerid] ][houseY], HouseDataInHouse[playerid] ][houseZ]);
                    
InHouse[playerid] = INVALID_HOUSE_ID;
                    return 
1;
                }
            }
        }
    }
    return 
1;