Problem with DestroyObject
#4

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;
}
Reply


Messages In This Thread
Problem with DestroyObject - by ZackBoolaro - 25.12.2012, 22:25
Re: Problem with DestroyObject - by Vince - 25.12.2012, 23:12
Re: Problem with DestroyObject - by JaKe Elite - 25.12.2012, 23:15
Re: Problem with DestroyObject - by Joe Staff - 26.12.2012, 01:34

Forum Jump:


Users browsing this thread: 1 Guest(s)