25.12.2012, 22:25
Hey there guys i'm making my Courier job script but i have a problem here.
The deliverpackages command should remove the the object i'm attaching to the vehicle in the loadpackages command. How to DestroyObject from the loadpackages command when i trype deliverpackages ?
pawn Код:
CMD:loadpackages(playerid, params[])
{
if(Courier[playerid] == 1 && IsPlayerInAnyVehicle(playerid))
{
new objectid = CreateObject(2973, 0, 0.9, -0.2, 0, 0, 0);
new vehicleid = GetPlayerVehicleID(playerid);
AttachObjectToVehicle(objectid, vehicleid, 0, 0.9, -0.2, 0, 0, 0);
} else {
SendClientMessage(playerid, COLOR_LIGHTRED, "You are either not courier or not in any vehicle !");
}
return 1;
}
CMD:deliverpackages(playerid, params[])
{
if(Courier[playerid] == 1)
{
DestroyObject(objectid);
GivePlayerMoney(playerid, 10);
SendClientMessage(playerid, COLOR_LIGHTRED, "You unloaded a package successfuly and received 10$ for it !");
}
return 1;
}