Spawned object
#1

I try to do a quest for halloween.how can do that with 5 minutes to spawn one of pumpkins?(random)
Код:
CreateObject(19320, 1410.1044, -1305.7026, 9.3780,0,0,0,0,0,0); // 
CreateObject(19320, 811.0631, -1098.3042, 25.9063,0,0,0,0,0,0); // 
CreateObject(19320, 395.0076, -1892.1541, 7.8301,0,0,0,0,0,0); // 
CreateObject(19320, 1208.2128, -1997.4165, 69.0078,0,0,0,0,0,0); // 
CreateObject(19320, 1291.9706, -788.6403, 96.4609,0,0,0,0,0,0); // 
CreateObject(19320, 1319.6095, 1254.3007, 14.2731,0,0,0,0,0,0); //lv
CreateObject(19320, 2000.8856, 1565.8356, 15.3672,0,0,0,0,0,0); // lv
CreateObject(19320, 2592.7739, 2790.8081, 10.8203,0,0,0,0,0,0); // lv
CreateObject(19320, 1058.6401, 1260.5609, 10.8203,0,0,0,0,0,0); // lv
CreateObject(19320, 1697.7155, 679.0499, 14.8222,0,0,0,0,0,0); // lv
CreateObject(19320, 2206.8350, 1286.4581, 10.8203,0,0,0,0,0,0); // lv
CreateObject(19320, 2060.2539, -2376.2620, 16.1250,0,0,0,0,0,0); // 
CreateObject(19320, 2505.8127, -1693.7687, 13.5579,0,0,0,0,0,0); // 
CreateObject(19320, 1883.6287, 1990.4550, 7.5946,0,0,0,0,0,0); // lv
Reply
#2

You pack them in an array:

PHP код:
stock const Float:pumpkins[][3] = {
    {
1410.1044, -1305.70269.3780},
    {
811.0631, -1098.304225.9063},
    {
395.0076, -1892.15417.8301},
    {
1208.2128, -1997.416569.0078},
    {
1291.9706, -788.640396.4609},
    {
1319.60951254.300714.2731},
    {
2000.88561565.835615.3672},
    {
2592.77392790.808110.8203},
    {
1058.64011260.560910.8203},
    {
1697.7155679.049914.8222},
    {
2206.83501286.458110.8203},
    {
2060.2539, -2376.262016.1250},
    {
2505.8127, -1693.768713.5579},
    {
1883.62871990.45507.5946}
};
//and then you can spawn them random:
new random(sizeof(pumpkins));
CreateObject(19320,pumpkins[p][0],pumpkins[p][1],pumpkins[p][2],0,0,0); 
Reply
#3

Код:
new Float:Spawns[][] =
{
    { 1410.1044,-1305.7026, 9.3780}, // keep going with "," like this example and in the last cord don't write ","
    {x,y,z},

}
Then
Код:
public OnGameModeInit()
{
    new randspawn = random(5);
    CreateDynamicObject(19320, Spawns[randspawn][0], Spawns[randspawn][1], Spawns[randspawn][2], 0, 0, 0, -1, -1, -1, 100.0);
}
This is just an example though to get you the basic idea
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)