Code For Loeading Objects And Vehicle
#1

delete
Reply
#2

Help ?
Reply
#3

I suppose i can tell you a good way of scripting this but please stop the
'!!!!' behind every line because it looks agressive and noone would wanna help you
Reply
#4

ok ,
sry ... you can give me help?
i need this i crazy every min "GMX" - i need help for this.
tnx
Reply
#5

Alright heres my way of doing this i dont know if you have any knowledge of scripting but ill explain it to you anyway.

first of all : above public OnGameModeInit you do;

pawn Код:
new boelieVehicles[MAX_VEHICLES];
new boelieObjects[MAX_OBJECTS];
this makes the objects and vehicles to a variable that can be used to make your own function.
How can you make your own function ?
something called 'stock' can do the trick.

for the vehicles do this;
pawn Код:
stock AddStaticVehicleValue(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2)
{
    new vehicleID = AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, angle, color1, color2);
    BoelieVehicles[vehicleID] = 1;
    return vehicleID;
}
Notice the 'BoelieVehicles' you added earlyer? you now made your own 'AddStaticVehicle' BUT with a special ingrediлnt. A new variable..
Doing this with Objects is just the same;
pawn Код:
stock CreateValuedObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ,Float:DrawDistance=0.0)
{
    new CDMid = CreateObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ,DrawDistance);
    BoelieObjects[CDMid] = 1;
    return CDMid;
}
I always place the stocks underneath my script. Whatever you do dont put in in a 'callback' ( the parts between public blablabla and return 1;

Now Replace all 'AddStaticVehicle' in your script with AddStaticVehicleValue
if you have CreateVehicle in your script then replace it also with AddStaticVehicleValue
With CreateObject you do the same; Replace the name CreateObject with CreateValuedObject

Now its time to make a function that destroys both Objects and Vehicles at the same time
so here comes the stock again;
pawn Код:
stock DestroyAllBoelie()
{
    for(new o=0;o<MAX_OBJECTS; o++)for(new v=0;v<MAX_VEHICLES; v++)
    {
        if(BoelieObjects[o] ==1)
        {
        DestroyObject(o);
        }
        if(BoelieVehicles[v] == 1)
        {
        DestroyVehicle(v);
        }
    }
}
There...if you want it all to be just respawned than just replace destroyvehicle with SetVehicleToRespawn.

Now add this function
pawn Код:
DestroyAllBoelie();
anywhere you want . It should destroy all objects and vehicles if you done correctly.
Reply
#6

XD ow and ofcourse after the objects and vehicles are destroyed you can simply add them all again by using all
addstaticvehiclevalue and createobjectvalues you made
Reply
#7

WTF ?!
you can do this in new file pawn and give me example?
***plz in website : http://pastebin.com/

tnx
Reply
#8

eurmm..this IS an example :S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)