Аренда лодок

Description: Уроки по скриптингу
Moderator: SJplayer

Miranda F
Topic author, Старшина
Старшина
Avatar
Miranda F
Topic author, Старшина
Старшина
Posts: 143
Joined: 5 Jul 2013
With us: 7 years 4 months

#1by Miranda » 18 Nov 2013, 17:14

Аренда лодок

ко всем new

Code: Select all

new arendlod[4];  


В public OnPlayerStateChange(playerid, newstate, oldstate)

Code: Select all

if(newcar >= arendlod[0] && newcar <= arendlod[3]) 
        { 
            if(
arenda[playerid] != GetPlayerVehicleID(playerid)) 
            { 
                
ShowPlayerDialog(playerid,9888,DIALOG_STYLE_MSGBOX" ""{FFFFFF}Аренда лодок Лос Сантос\nЗдравствуйте!\n\nСтоимость аренды составит: 2000{34c924}$\n{FFFFFF}Вы действительно хотите арендовать одну из лодок?\n\n{ff0000}Примечания:\n{FFFFFF}Не отпускайте руль лодки\nт.к вам придется арендовать заново.""Да""Нет"); 
                
TogglePlayerControllable(playerid0); 
            } 
        }  


В public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])

Code: Select all

case 9888
        { 
            if(
response
            { 
                if(
PlayerInfo[playerid][pCash] <= 1999
                { 
                    
SendClientMessage(playeridCOLOR_GREY"У вас недостаточно денег"); 
                    
RemovePlayerFromVehicleAc(playerid); 
                    
TogglePlayerControllable(playerid1); 
                    return 
true
                } 
                
PlayerInfo[playerid][pCash] -= 2000
                
arenda[playerid] = 1
                
TogglePlayerControllable(playerid1); 
                
GameTextForPlayer(playerid"~g~You rented a boat"50003); 
                return 
true
            } 
            else 
            { 
                
RemovePlayerFromVehicleAc(playerid); 
                
TogglePlayerControllable(playerid1); 
                return 
true
            } 
        }  


В CreateObjects() - где ваши объекты

Code: Select all

//============================= Аренда лодок =============================== 
    
CreateObject(11496,915.7550049,-1924.5670166,0.0120000,0.0000000,0.0000000,0.0000000); //object(des_wjetty) (1) 
    
CreateObject(11495,914.1859741,-1905.6639404,0.0180000,0.0000000,0.0000000,0.0000000); //object(des_ranchjetty) (1) 
    
CreateObject(11495,912.4019775,-1905.6710205,0.0130000,0.0000000,0.0000000,179.9995117); //object(des_ranchjetty) (2) 
    
CreateObject(11496,910.7849731,-1924.5629883,0.0130000,0.0000000,0.0000000,180.0000000); //object(des_wjetty) (2) 
    
CreateObject(1461,920.1090088,-1916.6169434,1.0130000,0.0000000,0.0000000,270.0000000); //object(dyn_life_p) (1) 
    
CreateObject(1461,920.1129761,-1932.4949951,1.0130000,0.0000000,0.0000000,270.0000000); //object(dyn_life_p) (2) 
    
CreateObject(1461,906.4240112,-1916.6739502,1.0140001,0.0000000,0.0000000,88.0000000); //object(dyn_life_p) (3) 
    
CreateObject(1461,906.4306641,-1932.4794922,1.0140001,0.0000000,0.0000000,87.9949951); //object(dyn_life_p) (4) 
    
CreateObject(1637,905.0369873,-1888.6199951,2.3440001,0.0000000,0.0000000,270.0000000); //object(od_pat_hutb) (1)  


В CreateVehicles() - где ваш транспорт

Code: Select all

//================================= Аренда лодок =========================== 
    
arendlod[0] = AddStaticVehicle(473,904.4608,-1919.7269,-0.0978,174.9103,4,4); // 
    
arendlod[1] = AddStaticVehicle(473,904.6183,-1927.8468,-0.4734,177.9866,4,4); // 
    
arendlod[2] = AddStaticVehicle(473,921.7468,-1928.8716,-0.4424,181.0097,4,4); // 
    
arendlod[3] = AddStaticVehicle(473,921.8669,-1918.6177,-0.0679,180.3532,4,4); //  

Скриншоты
Image

Image

Image
Image

! ! !


Return to “Уроки”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest