Страница 1 из 11
Форум » PAWNO » Уроки Pawno » [Мануал] Работа строителя [Mystic RP]
[Мануал] Работа строителя [Mystic RP]
Дмитрий Дата: Среда, 30.07.2014, 20:14 | Сообщение # 1 | Сообщить о нерабочей теме


Аватар для Дмитрий

Автор вырезки: Unreal
Вырезано с мода Mystic RP.
Работа полностью на пикапах.

Ко всем new
Код
new razdel,kirplog;  
new kirp1,kirp2,kirp3;  
new Stroitel[MAX_PLAYERS];  
new Kirp[MAX_PLAYERS];  
new kirpzp[MAX_PLAYERS];  
new penoblokzp[MAX_PLAYERS];  


В OnGameModeInit
Код
kirplog = CreatePickup(3798,23,-2041.1079,308.4821,35.1926);  
razdel = CreatePickup(1275,23,-2098.7800,257.9827,36.1286);  
kirp1 = CreatePickup(19197,23,-2126.9829,276.1057,35.4507);  
kirp2 = CreatePickup(19197,23,-2131.0110,229.9198,35.6773);  
kirp3 = CreatePickup(19197,23,-2104.3020,121.2063,35.3045);  
//---- 3д тексты----//  
CreateDynamic3DTextLabel( "Кирпичи", 0xFFFFFFFF, -2126.9829,276.1057,35.4507,10,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,1, -1, -1);  
CreateDynamic3DTextLabel( "Кирпичи", 0xFFFFFFFF, -2131.0110,229.9198,35.6773,10,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,1, -1, -1);  
CreateDynamic3DTextLabel( "Пеноблоки", 0xFFFFFFFF, -2104.3020,121.2063,35.3045,10,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,1, -1, -1);  


В Public OnPlayerPickUpPickup
Код
if(pickupid == razdel)
     {
         if(Stroitel[playerid] == 0 && PlayerInfo[playerid][pMember] == 0)
         {
             ShowPlayerDialog(playerid,1118,DIALOG_STYLE_MSGBOX,"Раздевалка строителей","Хотите начать работу строителя?","Да","Нет");
             return 1;
         }
         else
         {
             ShowPlayerDialog(playerid,1119,DIALOG_STYLE_MSGBOX,"Раздевалка строителей","Хотите завершить работу строителя?","Да","Нет");
             return true;
         }
     }
     if(pickupid == kirp1)
     {
         if(Stroitel[playerid] == 1)
            {
             if(Kirp[playerid] == 0)
             {
                 Kirp[playerid] = 1;
                 ApplyAnimation(playerid, "CARRY", "liftup", 4.0, 0, 0, 0, 1, 1);
                 SetTimerEx("ClearAnimText2", 1000, false, "d", playerid);
                 SetPlayerAttachedObject(playerid, 4, 2936, 1, 0.184699, 0.426247, 0.000000, 259.531341, 80.949592, 0.000000, 0.476124, 0.468181, 0.470769);
                 return 1;
             }
             else
             {
                 SendClientMessage(playerid,COLOR_GREY,"У вас уже есть кирпич");
             }
         }
         else
         {
         SendClientMessage(playerid,COLOR_GREY,"Вы не можете взять кирпич, для начала работы переоденьтесь в одежду {00FFFF}строителя.");
         }
     }
        if(pickupid == kirp2)
     {
         if(Stroitel[playerid] == 1)
            {
             if(Kirp[playerid] == 0)
             {
                 Kirp[playerid] = 1;
                 ApplyAnimation(playerid, "CARRY", "liftup", 4.0, 0, 0, 0, 1, 1);
                 SetTimerEx("ClearAnimText2", 1000, false, "d", playerid);
                 SetPlayerAttachedObject(playerid, 4, 2936, 1, 0.184699, 0.426247, 0.000000, 259.531341, 80.949592, 0.000000, 0.476124, 0.468181, 0.470769);
                 return 1;
             }
             else
             {
                 SendClientMessage(playerid,COLOR_GREY,"У вас уже есть кирпич");
             }
         }
         else
         {
         SendClientMessage(playerid,COLOR_GREY,"Вы не можете взять кирпич, для начала работы переоденьтесь в одежду {00FFFF}строителя.");
         }
     }
     if(pickupid == kirp3)
     {
          if(Stroitel[playerid] == 1)
            {
             if(Kirp[playerid] == 0)
             {
                 Kirp[playerid] = 2;
                 ApplyAnimation(playerid, "CARRY", "liftup", 4.0, 0, 0, 0, 1, 1);
                 SetTimerEx("ClearAnimText2", 1000, false, "d", playerid);
                 SetPlayerAttachedObject(playerid, 4, 2936, 1, 0.184699, 0.426247, 0.000000, 259.531341, 80.949592, 0.000000, 0.476124, 0.468181, 0.470769);
                 return 1;
             }
             else
             {
                 SendClientMessage(playerid,COLOR_GREY,"У вас уже есть пеноблок");
             }
         }
         else
         {
         SendClientMessage(playerid,COLOR_GREY,"Вы не можете взять пеноблок, для начала работы переоденьтесь в одежду {00FFFF}строителя.");
         }
     }
        if(pickupid == kirplog)
     {
         if(Kirp[playerid] == 0)
         {
             SendClientMessage(playerid,COLOR_GREY,"У вас нет кирпича!");
             return 1;
         }
         else
         {
             if(Kirp[playerid] == 1)
             {
                 Kirp[playerid] = 0;
                 RemovePlayerAttachedObject(playerid, 4);
                 ApplyAnimation(playerid,"CARRY","putdwn",4.1,0,1,1,1,1);
                 SendClientMessage(playerid,COLOR_WHITE,"Вы принесли обычный кирпич");
                 SetTimerEx("ClearAnimText", 1400, false, "d", playerid);
                 kirpzp[playerid]++;

             }
             if(Kirp[playerid] == 2)
             {
                 Kirp[playerid] = 0;
                 RemovePlayerAttachedObject(playerid, 4);
                 ApplyAnimation(playerid,"CARRY","putdwn",4.1,0,1,1,1,1);
                 SendClientMessage(playerid,COLOR_WHITE,"Вы принесли пеноблок");
                 SetTimerEx("ClearAnimText", 1400, false, "d", playerid);
                 penoblokzp[playerid]++;
             }
         }
     }


В OnPlayerConnect
Код
kirpzp[playerid] = 0; penoblokzp[playerid] = 0;


В Public OnDialogResponse
Код
case 1118:
         {
         if(response)
         {
             SetPlayerSkin(playerid,27);
             Stroitel[playerid] = 1;
             SendClientMessage(playerid,COLOR_WHITE,"Вы начали рабочий день строителя. {A41C1C}Отправляйтесь за кирпичами");
             return 1;
         }
         else
         {
         }
         }
         case 1119:
         {
         if(response)
         {
             new strings[256];
             new stri[256];
             new string[256];
             new money = kirpzp[playerid]*60+penoblokzp[playerid]*80;
             Kirp[playerid] = 0;
             Stroitel[playerid] = 0;
              RemovePlayerAttachedObject(playerid, 4);
              ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 1);
             if(PlayerInfo[playerid][pMember] >= 1 || PlayerInfo[playerid][pLeader] >= 1)
             {
                 SetPlayerSkin(playerid,PlayerInfo[playerid][pChar]);
             }
             if(PlayerInfo[playerid][pMember] == 0 || PlayerInfo[playerid][pLeader] == 0)
             {
                 SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
             }
             format(string, sizeof(string), "Вы закончили работу. Ваш заработок: {00FF00}$%d", money);
             SendClientMessage(playerid, COLOR_WHITE, string);
             format(stri, sizeof(stri), "Вы принесли {A41C1C}%d{FFFFFF}обычных кирпичей и {A41C1C}%d{FFFFFF}пеноблоков",kirpzp[playerid],penoblokzp[playerid]);
             SendClientMessage(playerid, COLOR_WHITE, stri);
             kirpzp[playerid] = 0;
             penoblokzp[playerid] = 0;
             GivePlayerMoney(playerid, money);
             format(strings, sizeof(strings), "~g~+%d$", money);
             GameTextForPlayer(playerid,strings,3000,1);
             return 1;
         }
         else
         {
         }
         }


В OnPlayerKeyStateChange
Код
if(KEY_SPRINT && Kirp[playerid] == 1 || KEY_JUMP && Kirp[playerid] == 1)
     {
         SendClientMessage(playerid,0xFFAA00FF, "Вы уронили кирпич!");
          ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 1);
         Kirp[playerid] = 0;
            RemovePlayerAttachedObject(playerid, 4);
         return 1;
     }


И в конец мода:
Код
forward ClearAnimText2(playerid);
public ClearAnimText2(playerid)
{
     //ClearAnimations(playerid);
     ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 1, 1);
     return 1;
}

forward ClearAnimText(playerid);
public ClearAnimText(playerid)
{
     //ClearAnimations(playerid);
     ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0);
     return 1;
}


Вот и все.

Местоположение: Напротив ЖДСФ, там стройка.


From Russia With Love!
Переезд на GiG-PRO.RU |---> Узнать больше <---|
Форум » PAWNO » Уроки Pawno » [Мануал] Работа строителя [Mystic RP]
Страница 1 из 11
Поиск: