26.12.2012, 01:34
Just to reiterate what Romel and Vince said, here's you're current code updated.
pawn Код:
new packageObjectID=-1;
CMD:loadpackages(playerid, params[])
{
if(Courier[playerid] == 1 && IsPlayerInAnyVehicle(playerid))
{
if(packageObjectID!=-1)DestroyObject(packageObjectID);
packageObjectID= 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(packageObjectID);
packageObjectID=-1;
GivePlayerMoney(playerid, 10);
SendClientMessage(playerid, COLOR_LIGHTRED, "You unloaded a package successfuly and received 10$ for it !");
}
return 1;
}