23.01.2014, 12:21
I got some idea and i need help to finish it. I want to make an Garbage job in this way.
- First: Player will go to the place where are garbages and when he enter in checkpoint he will take the garbage.
- Second: After he take the garbage he will need to put in the TrashMaster vehicle.
- Third: After timer finish the Garbage will be gone and he will need to deliver the truck to the Garbage Place.
- Four: When he enter in the Garbage Place (CheckPoint) to finish his Job.
But im trying to figure out so thats why im asking here.
CMD's: /takegarbage /placegarbage
- /takegarbage - setting the checkpoint location and when you go there you take the garbage.
- /placegarbage - after you take the garbage your next location will be to place it in vehicle.
I didnt test if this work, because i dont have idea how if one player take the garbage with id "djubreobj" and second player take the same then it will be wrong from one player will go to other, i want to maybe 30 peoples to can take an garbages.
CheckPoint:
The timer:
- First: Player will go to the place where are garbages and when he enter in checkpoint he will take the garbage.
- Second: After he take the garbage he will need to put in the TrashMaster vehicle.
- Third: After timer finish the Garbage will be gone and he will need to deliver the truck to the Garbage Place.
- Four: When he enter in the Garbage Place (CheckPoint) to finish his Job.
But im trying to figure out so thats why im asking here.
CMD's: /takegarbage /placegarbage
- /takegarbage - setting the checkpoint location and when you go there you take the garbage.
- /placegarbage - after you take the garbage your next location will be to place it in vehicle.
I didnt test if this work, because i dont have idea how if one player take the garbage with id "djubreobj" and second player take the same then it will be wrong from one player will go to other, i want to maybe 30 peoples to can take an garbages.
pawn Код:
CMD:takegarbage(playerid, params[])
{
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be logged in to can write commands.");
if(PlayerInfo[playerid][pJob] != JOB_GSMUGGLER && PlayerInfo[playerid][pVIPJob] != JOB_GSMUGGLER) return SendClientMessage(playerid, COLOR_GREY, "{FAFAFA}[{FFD200}INFO:{FAFAFA}] You are not {00B9FF}Garbage Smuggler{FAFAFA}.");
GarbJob[playerid] = 1;
SetPlayerCheckpoint(playerid,GarbJob1,11);
SendClientMessage(playerid, COLOR_WHITE, "{FAFAFA}[{FFD200}INFO{FAFAFA}]: Go to the location to take the Garbage.");
return 1;
}
CMD:placegarbage(playerid, params[])
{
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Moras biti logovan da bi koristio ovu komandu.");
if(PlayerInfo[playerid][pJob] != JOB_PETROL && PlayerInfo[playerid][pVIPJob] != JOB_PETROL) return SendClientMessage(playerid, COLOR_GREY, "{FAFAFA}[{FFD200}INFO:{FAFAFA}] Ti nisi vozac za {00B9FF}Petrol{FAFAFA}.");
new djcar;
djcar = GetPlayerVehicleID(playerid);
if(!IsPlayerInRangeOfPoint(playerid, 5, GarCar(djcar)) return SendClientMessage(playerid, COLOR_GREY, "You are not close to the vehicle.");
{
if(GarbJob[playerid] == 2)
{
GarbJob[playerid] = 3;
ClearAnimations(playerid, true);;
ApplyAnimation(playerid,"SWEET","Sweet_injuredloop", 4.0, 1, 0, 0, 1, 0);
SetTimerEx("OstaviDjubre", 10000, false, "i", playerid);
SendClientMessage(playerid, COLOR_WHITE, "[{FFD200}INFO{FAFAFA}]: Wait {00B9FF}10 sec more{FAFAFA} while destroys the garbage .");
return 1;
}
}
return 1;
}
pawn Код:
if IsPlayerInRangeOfPoint(playerid, 6,1635.8950, -1797.2969, 12.8883)) return SendClientMessage(playerid, COLOR_GREY, "You are not near garbage.");
{
if(GarbJob[playerid] == 1)
{
GarbJob[playerid] = 2;
SetPlayerCheckpoint(playerid,GarbJob1,10);// Next location where he need to go with truck
AttachObjectToPlayer(djubreobj, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2);
SendClientMessage(playerid, COLOR_WHITE, "[{FFD200}INFO{FAFAFA}]: You take the {00B9FF}Trash{FAFAFA} from the place, now put it into vehicle.");
return 1;
}
}
if(GarbJob[playerid] == 2)
{
GarbJob[playerid] = 3;
SetPlayerCheckpoint(playerid,GarbJob2,10);
SendClientMessage(playerid, COLOR_WHITE, "[{FFD200}INFO{FAFAFA}]: Your next location is {00B9FF}Garbage Place{FAFAFA}.");
return 1;
}
if(GarbJob[playerid] == 3)
{
GarbJob[playerid] = 4;
SetPlayerCheckpoint(playerid,GarbJob3,10);
return 1;
}
if(GarbJob[playerid] == 4)
{
GarbJob[playerid] = 0;
SendClientMessage(playerid, COLOR_WHITE, "[{FFD200}INFO{FAFAFA}]: You finish your job and earn {00B9FF}500$.");
GiveDodMoney(playerid, 8500);
new veh;
veh = GetPlayerVehicleID(playerid);
SetVehicleToRespawn(veh);
DisablePlayerCheckpoint(playerid);
}
}
The timer:
pawn Код:
forward OstaviDjubre(reportid);
public OstaviDjubre(reportid)
{
if(IsPlayerLoggedIn(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You placed the trash into the vehicle.");
DestroyPlayerObject(playerid, djubreobj);
ClearAnimations(playerid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your next location is to place the garbage.");
SetPlayerCheckpoint(playerid,GarbJob2,10);
}
return 1;
}