14.02.2012, 09:16
Проподают обьекты, проподают действия на вход обьектов. Плиз помогите
Код:
new string[64]; new vehicle = GetPlayerVehicleID(playerid); new model = GetVehicleModel(vehicle); if (pickupid == VSkladPickup && PlayerJob[playerid] != 0) { DestroyPickup(VSkladPickup); SetTimer("CreateVSkladPickup",8000,0); if(FermaStatus == 1 && PlayerJob[playerid] == 3 && model == 478) // Водитель берет зерно { if(!VSeeds[vehicle]) { SendClientMessage(playerid, COLOR_GREEN, "Вы загрузили свой богажник вы можете пойти получить зарплату"); SendClientMessage(playerid, COLOR_GREEN, "Или простой выйти из машины и снова зайти, так вы продолжите свою работу"); new rand = random(sizeof(travka)); SetPlayerCheckpoint(playerid,travka[rand][0],travka[rand][1],travka[rand][2],5.0); FermaStatus = 1; UpdateSklad(); PlayerInfo[playerid][pCrashfarm] += 500; format(string, sizeof(string), "~b~+%d",DRIVERPRICE); GameTextForPlayer(playerid, string, 3000, 1); GivePlayerMoney(playerid, DRIVERPRICE); fBalance-=DRIVERPRICE; VehSkl[vehicle][ArtAll] = 0; VehSkl[playerid][ArtAll] = 0; UpdateSklad(); } } //} else if(FermaStatus == 3 && PlayerJob[playerid] == 3 && model == 478) // Водитель разгружает урожай { if(VehSkl[vehicle][ArtAll]<MAX_VFINISHED) return 1; fFinished += VehSkl[vehicle][ArtAll]; VehSkl[vehicle][ArtAll] = 0; UpdateSklad(); SendClientMessage(playerid, COLOR_GREEN, "Вы разгрузили урожай на склад"); new Float: X,Float: Y; SetPlayerCheckpoint(playerid,X+random(4),Y+random(4),129.21875,1.0); CP[playerid] = 1; format(string, sizeof(string), "~b~+%d",DRIVERPRICE); GameTextForPlayer(playerid, string, 3000, 1); GivePlayerMoney(playerid, DRIVERPRICE); fBalance-=DRIVERPRICE; UpdateSklad(); } if(PlayerJob[playerid] == 4 && model == 456) { DisablePlayerCheckpoint(playerid); if(VSeeds[vehicle]) { fSeeds += VSeeds[vehicle]; VSeeds[vehicle] = 0; UpdateSklad(); SendClientMessage(playerid, COLOR_GREEN, "Вы разгрузили зерна на склад"); format(string, sizeof(string), "~b~+%d",DOSTAVKAPRICE); GameTextForPlayer(playerid, string, 3000, 1); GivePlayerMoney(playerid, DOSTAVKAPRICE); fBalance-=DOSTAVKAPRICE; UpdateSklad(); } else { if(fFinished>500) return 1; if(VehSkl[vehicle][ArtAll]) return 1; fFinished -= 20; UpdateSklad(); SendClientMessage(playerid, COLOR_GREEN, "Везите урожай на городской склад"); SetPlayerCheckpoint(playerid,POINT_PSKLAD,5.0); } } return 1; } if (pickupid == PSkladPickup && PlayerJob[playerid] != 0) { DestroyPickup(PSkladPickup); SetTimer("CreatePSkladPickup",8000,0); DisablePlayerCheckpoint(playerid); if(PlayerJob[playerid] == 4 && model == 456) { if(VehSkl[vehicle][ArtAll]) { VehSkl[vehicle][ArtAll] = 0; SendClientMessage(playerid, COLOR_GREEN, "Вы продали урожай на склад"); format(string, sizeof(string), "~b~+%d",DOSTAVKAPRICE); GameTextForPlayer(playerid, string, 3000, 1); GivePlayerMoney(playerid, DOSTAVKAPRICE); fBalance-=DOSTAVKAPRICE; fBalance+=FINISHEDPRICE*20; UpdateSklad(); } else { SetPlayerCheckpoint(playerid,POINT_VSKLAD,5.0); VSeeds[vehicle] = 500; SendClientMessage(playerid, COLOR_RED, "Везите зерно на склад"); fBalance-=SEEDPRICE*20; UpdateSklad(); } } return 1; } if (pickupid == PSkladPickupe) { ShowPlayerDialog(playerid,8601,DIALOG_STYLE_MSGBOX,"Информация о работе","Здесь вы можете подработать сборщиком урожая\n\nЧто бы начать работу найдите фермера,\nон все вам объкснит.\n\nНеподалеку находится раздевалка, там же получать деньги.\n\nЧто бы начать работу необходимо переодется в робу,\nДалее вам укажут, где брать груз.\n\nКак только вы захотите завершить рабочий день,\nприходите к раздевалке. ","Скрыть",""); return 1; } if (pickupid == SkladPickup) { ShowPlayerDialog(playerid,8600,DIALOG_STYLE_MSGBOX,"Раздевалка","Вы хотите начать или закончить работу?","Начать","Закончить"); return 1; } for(new i=0; i<24; i++) { if(pickupid == SeedPickup[i] && pickupid != 0) { // if(!PlayerSeeds[playerid]) return SendClientMessage(playerid, COLOR_RED, "У вас нету семян, возьмите их в машине"); // PlayerSeeds[playerid]--; DestroyPickup(SeedPickup[i]); SetTimerEx("Posadka", 3000, 0, "dd", playerid,i); TogglePlayerControllable(playerid, 0); SetPlayerAttachedObject(playerid, 3, 2247, 6, -0.003353, 0.093383, 0.176903, 0.000000, 0.000000, 0.000000, 0.788097, 1.000000, 0.991011); //RemovePlayerAttachedObject(playerid,2); ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,0,0); SeedCount++; SeedPickup[i] = -1; if(SeedCount >= 24) { SendClientMessage(playerid, COLOR_YELLOW, "Вы посадили все растения"); SeedCount = 0; SeedTimer = SetTimer("UpdateSeed",100,1); return 1; } return 1; } } for(new i=0; i<24; i++) { if(pickupid == SeedPickup2[i] && pickupid != 0) // PlayerJob[playerid] == 4 { if(model != 532) { // SeedPickup2[i] = CreatePickup(1239,14,travka[i][0],travka[i][1],129.21875,-1); // для машины return 1; } DestroyPickup(SeedPickup2[i]); DestroyObject(SeedObject[i]); SeedCount++; SeedPickup2[i] = -1; format(string, sizeof(string), "~b~+%d",COMBAINERPRICE); GameTextForPlayer(playerid, string, 3000, 1); GivePlayerMoney(playerid, COMBAINERPRICE); fBalance-=COMBAINERPRICE; UpdateSklad(); if(SeedCount >= 24) { for(new x=0; x<MAX_PLAYERS; x++) if(IsPlayerConnected(x)) { if(PlayerJob[x]>0) SendClientMessage(x, COLOR_GREEN, "Урожай скошен"); } FermaStatus = 3; SeedCount = 0; return 1; } return 1; } } new nearveh = GetNearestVehicle(playerid); if (pickupid == JobPickup1[nearveh] && PlayerJob[playerid] != 0) { if(VehSkl[vehicle][ArtAll] == MAX_VSEEDS) { RemovePlayerAttachedObject(playerid,2); RemovePlayerAttachedObject(playerid,3); DisablePlayerCheckpoint(playerid); SendClientMessage(playerid, COLOR_RED, "Багажник заполнен"); // SetPlayerRaceCheckpoint(playerid,1,-382.0170,-1439.0886,25.7266,0.0,0.0,0.0,3); if(PlayerJob[playerid] == 3) return SetPlayerRaceCheckpoint(playerid,1,POINT_VSKLAD,0.0,0.0,0.0,3); return 1; } if(!PlayerSeeds[playerid]) { // if(!VSeeds[nearveh]) return SendClientMessage(playerid, COLOR_RED, "Зерна кончились"); // VSeeds[nearveh]--; SetPlayerCheckpoint(playerid,Xues+random(4),Yues+random(4),129.21875,1.0); CP[playerid] = 1; // SetPlayerCheckpoint(vehicle,X+random(10),Y+random(10),Z+random(10), 2.0); format(string, sizeof(string), "{7fc7ff}Загруженно\n{ffffff}%d / 500",VehSkl[vehicle][ArtAll]); Update3DTextLabelText(JobText1[nearveh], COLOR_SPRINGGREEN, string); // PlayerSeeds[playerid] = 0; RemovePlayerAttachedObject(playerid,2); RemovePlayerAttachedObject(playerid,3); return 1; } } if (pickupid == JobPickup2[nearveh] && PlayerJob[playerid] != 0) { if(VehSkl[nearveh][ArtAll] >= MAX_VSEEDS && !FermerStatus[playerid]) return 1; // new rand = random(sizeof(travka)); SetPlayerCheckpoint(playerid,Xues+random(4),Yues+random(4),129.21875,1.0); CP[playerid] = 1; if(FermerStatus[playerid]) { // if(VehSkl[nearveh][ArtAll] >= MAX_VFINISHED) return SendClientMessage(playerid, COLOR_RED, "Багажник заполнен"); PlayerInfo[vehicle][MeneyCraft] += 25; format(string, sizeof(string), "~b~cost ~w~+%d",PlayerInfo[vehicle][MeneyCraft]); DisablePlayerCheckpoint(playerid); GameTextForPlayer(playerid, string, 3000, 1); fBalance-=PlayerInfo[vehicle][MeneyCraft]; format(string, sizeof(string), "{7fc7ff}Загруженно\n{ffffff}%d / 500",VehSkl[nearveh][ArtAll]); FermerStatus[playerid] = 0; if(IsPlayerAttachedObjectSlotUsed(playerid,2)) SetPlayerAttachedObject(playerid, 3, 2247, 6, -0.003353, 0.093383, 0.176903, 0.000000, 0.000000, 0.000000, 0.788097, 1.000000, 0.991011); //RemovePlayerAttachedObject(playerid,2); ApplyAnimation(playerid,"PED","IDLE_tired",4.1,0,1,1,0,1); if(VehSkl[nearveh][ArtAll] >= MAX_VFINISHED) return DisablePlayerCheckpoint(playerid); UpdateSklad(); return 1; } }