12.10.2010, 13:54
Try this
Command to load........
Funtion of loading
On Reach Checkpoint
You have to define Loaded in your CarInfo array.......
Command to load........
Quote:
if(strcmp(cmd, "/Loadmats", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pJob] == 24) { if(!IsPlayerInRangeOfPoint(playerid, 6, 2509.0718,-2120.6606,13.5469))//Write you coords here { SendClientMessage(playerid, COLOR_GREY,"You are not a at factory."); } if(GetPlayerState(playerid) == 2) { new vehicle = GetPlayerVehicleID(playerid); if(IsModelATruck(vehicle)) { TogglePlayerControllable(playerid, 0); SendClientMessage(playerid, COLOR_GROVE,"Loading Materials please wait!"); SetPlayerCameraPos(playerid, 2509.0718,-2120.6606,13.5469);//camera pos while loading SetPlayerCameraLookAt(playerid, 2517.7261,-2099.2830,13.5469); SetTimer("LoadingMats", 10000, 0);//loading timer 10mins } } return 1; } else { SendClientMessage(playerid, COLOR_GREY,"You are not a Trucker."); } return 1; } } |
Quote:
At top : forward LoadingMats(playerid); And public LoadingMats(playerid) { new vehicle = GetPlayerVehicleID(playerid); if(IsPlayerConnected(playerid)) { SetCameraBehindPlayer(playerid); TogglePlayerControllable(playerid, 1); SendClientMessage(playerid, COLOR_GREY,"Materials loaded succesfully."); GameTextForPlayer(playerid, "Deliver Mats Boxes to Red Mark", 5000, 3); SetPlayerCheckpoint(playerid, -88.2457,-1591.1256,2.6172, 3.0);//change coords where u want check point CarInfo[vehicle][Loaded] = 1; } return 1; } |
Quote:
if(CarInfo[vehicle][Loaded] == 1) { if(PlayerInfo[playerid][pJob] == 24) { DisablePlayerCheckpoint(playerid); PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0); SendClientMessage(playerid, COLOR_WHITE, "Factory give you 500 Dollars For 10 Mats Boxes."); SafeGivePlayerMoney(playerid, 500); CarInfo[vehicle][Loaded] = 0; } return 1; } |