25.02.2014, 18:47
It dosen't work with "
Код:
DeliverX , DeliverY, DeliverZ is checkpoint deliver products for business
Код:
CMD:nhanchuyenhang(playerid, params[]) { if(PlayerInfo[playerid][pJob] == 20 || PlayerInfo[playerid][pJob2] == 20) { new vehicleid = GetPlayerVehicleID(playerid); if(IsATruckerCar(vehicleid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { if(!CheckPointCheck(playerid)) { if(GetPVarInt(playerid, "LoadTruckTime") > 0) { SendClientMessageEx(playerid, COLOR_WHITE, "Ban dang cho tiep nhan hang hoa!"); return 1; } if(TruckUsed[playerid] != INVALID_VEHICLE_ID) { SendClientMessageEx(playerid, COLOR_WHITE, "Ban da ve cung cap khac, go /huybo chuyenhang de huy bo giao dich."); return 1; } gPlayerCheckpointStatus[playerid] = CHECKPOINT_LOADTRUCK; SetPlayerCheckpoint(playerid,-1572.767822, 81.137527, 3.554687, 4); GameTextForPlayer(playerid, "~w~danh dau diem ~r~ve ben cang SF", 5000, 1); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Chon mot so hang hoa tai San Fierro Docks (tren radar cua ban)."); } else return SendClientMessageEx(playerid, COLOR_WHITE, "Xin vui long xoa bo Muc tieu dau tien (Ban co the co Goi vat lieu, hoac cac muc tieu khac)."); } else return SendClientMessageEx(playerid, COLOR_GREY, "Ban Khong duoc lai xe tai xe cua Ben cang San Ferrico!"); } else return SendClientMessageEx(playerid, COLOR_GREY, "Ban khong phai la Tai xe!"); return 1; } forward LoadTruck(playerid); public LoadTruck(playerid) { SetPVarInt(playerid, "LoadTruckTime", GetPVarInt(playerid, "LoadTruckTime")-1); new string[128]; format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~%d giay cho doi", GetPVarInt(playerid, "LoadTruckTime")); GameTextForPlayer(playerid, string, 1100, 3); if(GetPVarInt(playerid, "LoadTruckTime") > 0) SetTimerEx("LoadTruck", 1000, 0, "d", playerid); if(GetPVarInt(playerid, "LoadTruckTime") <= 0) { DeletePVar(playerid, "LoadTruckTime"); DeletePVar(playerid, "IsFrozen"); TogglePlayerControllable(playerid, 1); new vehicleid = GetPlayerVehicleID(playerid); new truckdeliver = GetPVarInt(playerid, "TruckDeliver"); TruckContents{vehicleid} = truckdeliver; TruckUsed[playerid] = vehicleid; new rand = random(200 - 1); if(BizzInfo[rand][bDeliverX] == 0 || BizzInfo[rand][bDeliverY] == 0 || BizzInfo[rand][bDeliverZ] == 0) { rand = 0; if(++rand >= MAX_BUSINESSES) { rand = 0; } } if(truckdeliver == 1) { SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen Luong thuc va Nuoc uong."); new szMessage[1480]; for(new i = 5; i < sizeof( BizzInfo ); i++) { if(BizzInfo[i][bType] == 6) { format(szMessage, sizeof(szMessage), "%s%s (ID %d), Hue Hong Thu Mua San Pham Cho Ban la %d$.\n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]); ShowPlayerDialog(playerid,DIALOG_THUMUALT,DIALOG_STYLE_LIST,"Hue Hong Thu Mua San Pham Cho Ban", szMessage,"Chon","huy bo"); //SetPVarInt(playerid, "ThuMuaVL", i); } } } else if(truckdeliver == 2) { SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen Luong thuc va Nuoc uong."); new szMessage[1480]; for(new i = 5; i < sizeof( BizzInfo ); i++) { if(BizzInfo[i][bType] == 6) { format(szMessage, sizeof(szMessage), "%s%s (ID %d), Hue Hong Thu Mua San Pham Cho Ban la %d$.\n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]); ShowPlayerDialog(playerid,DIALOG_THUMUALT,DIALOG_STYLE_LIST,"Hue Hong Thu Mua San Pham Cho Ban", szMessage,"Chon","huy bo"); //SetPVarInt(playerid, "ThuMuaVL", i); } } } else if(truckdeliver == 3) { SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen Luong thuc va Nuoc uong."); new szMessage[1480]; for(new i = 5; i < sizeof( BizzInfo ); i++) { if(BizzInfo[i][bType] == 6) { format(szMessage, sizeof(szMessage), "%s%s (ID %d), Hue Hong Thu Mua San Pham Cho Ban la %d$.\n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]); ShowPlayerDialog(playerid,DIALOG_THUMUALT,DIALOG_STYLE_LIST,"Hue Hong Thu Mua San Pham Cho Ban", szMessage,"Chon","huy bo"); //SetPVarInt(playerid, "ThuMuaVL", i); } } } else if(truckdeliver == 4) { SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen Quan ao."); new szMessage[1480]; for(new i = 40; i < sizeof( BizzInfo ); i++) { if(BizzInfo[i][bType] == 2) { format(szMessage, sizeof(szMessage), "%s%s (ID %d), Hue Hong Thu Mua San Pham Cho Ban la %d$.\n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]); ShowPlayerDialog(playerid,DIALOG_THUMUAQA,DIALOG_STYLE_LIST,"Hue Hong Thu Mua San Pham Cho Ban", szMessage,"Chon","huy bo"); //SetPVarInt(playerid, "ThuMuaVL", i); } } } else if(truckdeliver == 5) { SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen Quan ao."); new szMessage[1480]; for(new i = 40; i < sizeof( BizzInfo ); i++) { if(BizzInfo[i][bType] == 2) { format(szMessage, sizeof(szMessage), "%s%s (ID %d), Hue Hong Thu Mua San Pham Cho Ban la %d$.\n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]); ShowPlayerDialog(playerid,DIALOG_THUMUAQA,DIALOG_STYLE_LIST,"Hue Hong Thu Mua San Pham Cho Ban", szMessage,"Chon","huy bo"); //SetPVarInt(playerid, "ThuMuaVL", i); } } } else if(truckdeliver == 6) { SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen Quan ao."); new szMessage[1480]; for(new i = 40; i < sizeof( BizzInfo ); i++) { if(BizzInfo[i][bType] == 2) { format(szMessage, sizeof(szMessage), "%s%s (ID %d), Hue Hong Thu Mua San Pham Cho Ban la %d$.\n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]); ShowPlayerDialog(playerid,DIALOG_THUMUAQA,DIALOG_STYLE_LIST,"Hue Hong Thu Mua San Pham Cho Ban", szMessage,"Chon","huy bo"); //SetPVarInt(playerid, "ThuMuaVL", i); } } } else if(truckdeliver == 7) { SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen Vat Lieu."); new szMessage[1480]; for(new i = 0; i < sizeof( BizzInfo ); i++) { if(BizzInfo[i][bType] == 4) { format(szMessage, sizeof(szMessage), "%s%s (ID %d), Gia Mua Vat Lieu la %d$.\n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]); ShowPlayerDialog(playerid,DIALOG_THUMUAVLHP,DIALOG_STYLE_LIST,"Gia Thu Mua Vat Lieu", szMessage,"Chon","huy bo"); //SetPVarInt(playerid, "ThuMuaVl", i); } } //SetPlayerCheckpoint(playerid, 2197.721923, -1975.567260, 13.359717, 5); } else if(truckdeliver == 8) { SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen mat hang 24/7."); new szMessage[1480]; for(new i = 15; i < sizeof( BizzInfo ); i++) { if(BizzInfo[i][bType] == 1) { format(szMessage, sizeof(szMessage), "%s%s (ID %d), Gia Mua Vat Lieu la %d$.\n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]); ShowPlayerDialog(playerid,DIALOG_THUMUAVL247,DIALOG_STYLE_LIST,"Gia Thu Mua Vat Lieu", szMessage,"Chon","huy bo"); //SetPVarInt(playerid, "ThuMuaVl", i); } } } else if(truckdeliver == 9) { SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen mat hang 24/7."); new szMessage[1480]; for(new i = 15; i < sizeof( BizzInfo ); i++) { if(BizzInfo[i][bType] == 1) { format(szMessage, sizeof(szMessage), "%s%s (ID %d), Gia Mua Vat Lieu la %d$.\n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]); ShowPlayerDialog(playerid,DIALOG_THUMUAVL247,DIALOG_STYLE_LIST,"Gia Thu Mua Vat Lieu", szMessage,"Chon","huy bo"); //SetPVarInt(playerid, "ThuMuaVl", i); } } } else if(truckdeliver == 10) { SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen mat hang 24/7."); new szMessage[1480]; for(new i = 15; i < sizeof( BizzInfo ); i++) { if(BizzInfo[i][bType] == 1) { format(szMessage, sizeof(szMessage), "%s%s (ID %d), Gia Mua Vat Lieu la %d.\n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]); ShowPlayerDialog(playerid,DIALOG_THUMUAVL247,DIALOG_STYLE_LIST,"Gia Thu Mua Vat Lieu", szMessage,"Chon","huy bo"); //SetPVarInt(playerid, "ThuMuaVl", i); } } } else if(truckdeliver >= 11 && truckdeliver <= 15) { SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen vat lieu che tao Vu khi bat hop phap."); GivePlayerCash(playerid, -5000); new szMessage[1480]; for(new i; i < sizeof( BizzInfo ); i++) { if(BizzInfo[i][bType] == 4) { format(szMessage, sizeof(szMessage), "%s%s (ID %d), Gia Mua Vat Lieu la %d. \n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]); ShowPlayerDialog(playerid,DIALOG_THUMUAVL,DIALOG_STYLE_LIST,"Gia Thu Mua Vat Lieu", szMessage,"Chon","huy bo"); } } //SetPlayerCheckpoint(playerid, 2781.596435, -2494.261230, 13.457942, 5); } else if(truckdeliver >= 16 && truckdeliver <= 20) { SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen Ma tuy."); GivePlayerCash(playerid, -5000); SetPlayerCheckpoint(playerid, 2443.682373, -1426.901489, 23.796508, 5); } else if(truckdeliver >= 21 && truckdeliver <= 25) { SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen Vat Lieu Bat hop phap."); GivePlayerCash(playerid, -5000); SetPlayerCheckpoint(playerid, 2166.486083, -2273.158935, 13.166786, 5); } SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Giao hang hoa cho vi tri quy dinh (Nhin tren ban do)."); SendClientMessageEx(playerid, COLOR_REALRED, "Canh Bao: Can than voi chiec xe tai, nguoi choi khac co the chiem quyen dieu khien xe cua ban."); if(truckdeliver >= 11) { SendClientMessageEx(playerid, COLOR_REALRED, "CANH CAO #2: Ban dang van chuyen hang hoa bat hop phap,neu ban bi canh sat bat co the se vao tu,va hop dong la dat coc 5000$."); } SetPVarInt(playerid, "tpTruckRunTimer", 30); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPTRUCKRUNTIMER); } return 1; }