[HELP] Random Pickup Pos?
#1

Hi guys,

How to I create pickup to random possitions.My Codes doesn't work.Because if players teking pickup, after pickup spawn same coordinates.. Plz help.

Sorry my english bad.

My Codes:
PHP код:
new Float:rastgeleZirhPickup[51][3] =
{
    {
263.9325,-271.1338,1181.6563},
    {
265.8892,-270.7938,1181.6563},
    {
268.0133,-269.7187,1181.6563},
    {
270.0383,-275.9179,1181.6563},
    {
272.8559,-274.4918,1181.6563},
    {
274.9379,-273.4380,1181.6563},
    {
276.6492,-262.8387,1181.6563},
    {
272.4637,-261.2182,1181.6563},
    {
262.9818,-275.2536,1181.6563},
    {
257.2866,-266.4196,1181.6563},
    {
251.3973,-276.3630,1181.6563},
    {
248.2588,-261.2187,1185.8173},
    {
253.8541,-261.0517,1185.8173},
    {
255.8856,-261.1027,1185.8173},
    {
260.3749,-261.4998,1185.8173},
    {
263.4521,-261.4211,1185.8173},
    {
283.9682,-260.8960,1185.8173},
    {
279.5124,-264.2802,1181.6563},
    {
267.3039,-258.2576,1181.6563},
    {
255.2964,-263.1861,1184.4354},
    {
249.5303,-261.3873,1185.8173},
    {
249.0952,-265.7135,1183.5509},
    {
247.9244,-282.3086,1181.6563},
    {
256.3747,-270.1659,1181.6563},
    {
271.4233,-272.0525,1181.6563},
    {
281.8883,-281.4579,1181.6563},
    {
279.4747,-277.5747,1185.8199},
    {
265.6163,-279.1992,1185.8235},
    {
252.8901,-279.3804,1185.8160},
    {
267.2919,-258.1317,1185.8203},
    {
271.5889,-261.2592,1185.8120},
    {
274.1129,-261.6598,1181.6563},
    {
262.7912,-265.6473,1181.6563},
    {
258.5964,-276.4184,1181.6563},
    {
273.9452,-274.8064,1181.6563},
    {
273.6962,-270.0783,1181.6563},
    {
264.3293,-272.1112,1181.6563},
    {
249.8487,-276.9585,1181.6563},
    {
248.4357,-271.3938,1181.6563},
    {
266.9960,-264.8860,1181.6563},
    {
260.7318,-261.3655,1181.6563},
    {
263.0797,-281.2147,1181.6563},
    {
278.5888,-276.6051,1181.6563},
    {
282.5634,-280.0367,1185.8195},
    {
281.7803,-269.3492,1185.8113},
    {
277.7030,-261.2810,1185.8113},
    {
275.4578,-261.2827,1185.8113},
    {
273.1691,-261.2846,1185.8113},
    {
268.9511,-261.2878,1185.8113},
    {
265.0761,-261.2909,1185.8113},
    {
258.1911,-261.2963,1185.8113}
};
new 
Float:rastgeleCanPickup[51][3] =
{
    {
263.9325,-271.1338,1181.6563},
    {
265.8892,-270.7938,1181.6563},
    {
268.0133,-269.7187,1181.6563},
    {
270.0383,-275.9179,1181.6563},
    {
272.8559,-274.4918,1181.6563},
    {
274.9379,-273.4380,1181.6563},
    {
276.6492,-262.8387,1181.6563},
    {
272.4637,-261.2182,1181.6563},
    {
262.9818,-275.2536,1181.6563},
    {
257.2866,-266.4196,1181.6563},
    {
251.3973,-276.3630,1181.6563},
    {
248.2588,-261.2187,1185.8173},
    {
253.8541,-261.0517,1185.8173},
    {
255.8856,-261.1027,1185.8173},
    {
260.3749,-261.4998,1185.8173},
    {
263.4521,-261.4211,1185.8173},
    {
283.9682,-260.8960,1185.8173},
    {
279.5124,-264.2802,1181.6563},
    {
267.3039,-258.2576,1181.6563},
    {
255.2964,-263.1861,1184.4354},
    {
249.5303,-261.3873,1185.8173},
    {
249.0952,-265.7135,1183.5509},
    {
247.9244,-282.3086,1181.6563},
    {
256.3747,-270.1659,1181.6563},
    {
271.4233,-272.0525,1181.6563},
    {
281.8883,-281.4579,1181.6563},
    {
279.4747,-277.5747,1185.8199},
    {
265.6163,-279.1992,1185.8235},
    {
252.8901,-279.3804,1185.8160},
    {
267.2919,-258.1317,1185.8203},
    {
271.5889,-261.2592,1185.8120},
    {
274.1129,-261.6598,1181.6563},
    {
262.7912,-265.6473,1181.6563},
    {
258.5964,-276.4184,1181.6563},
    {
273.9452,-274.8064,1181.6563},
    {
273.6962,-270.0783,1181.6563},
    {
264.3293,-272.1112,1181.6563},
    {
249.8487,-276.9585,1181.6563},
    {
248.4357,-271.3938,1181.6563},
    {
266.9960,-264.8860,1181.6563},
    {
260.7318,-261.3655,1181.6563},
    {
263.0797,-281.2147,1181.6563},
    {
278.5888,-276.6051,1181.6563},
    {
282.5634,-280.0367,1185.8195},
    {
281.7803,-269.3492,1185.8113},
    {
277.7030,-261.2810,1185.8113},
    {
275.4578,-261.2827,1185.8113},
    {
273.1691,-261.2846,1185.8113},
    {
268.9511,-261.2878,1185.8113},
    {
265.0761,-261.2909,1185.8113},
    {
258.1911,-261.2963,1185.8113}
};
new 
Float:rastgeleParaPickup[51][3] =
{
    {
263.9325,-271.1338,1181.6563},
    {
265.8892,-270.7938,1181.6563},
    {
268.0133,-269.7187,1181.6563},
    {
270.0383,-275.9179,1181.6563},
    {
272.8559,-274.4918,1181.6563},
    {
274.9379,-273.4380,1181.6563},
    {
276.6492,-262.8387,1181.6563},
    {
272.4637,-261.2182,1181.6563},
    {
262.9818,-275.2536,1181.6563},
    {
257.2866,-266.4196,1181.6563},
    {
251.3973,-276.3630,1181.6563},
    {
248.2588,-261.2187,1185.8173},
    {
253.8541,-261.0517,1185.8173},
    {
255.8856,-261.1027,1185.8173},
    {
260.3749,-261.4998,1185.8173},
    {
263.4521,-261.4211,1185.8173},
    {
283.9682,-260.8960,1185.8173},
    {
279.5124,-264.2802,1181.6563},
    {
267.3039,-258.2576,1181.6563},
    {
255.2964,-263.1861,1184.4354},
    {
249.5303,-261.3873,1185.8173},
    {
249.0952,-265.7135,1183.5509},
    {
247.9244,-282.3086,1181.6563},
    {
256.3747,-270.1659,1181.6563},
    {
271.4233,-272.0525,1181.6563},
    {
281.8883,-281.4579,1181.6563},
    {
279.4747,-277.5747,1185.8199},
    {
265.6163,-279.1992,1185.8235},
    {
252.8901,-279.3804,1185.8160},
    {
267.2919,-258.1317,1185.8203},
    {
271.5889,-261.2592,1185.8120},
    {
274.1129,-261.6598,1181.6563},
    {
262.7912,-265.6473,1181.6563},
    {
258.5964,-276.4184,1181.6563},
    {
273.9452,-274.8064,1181.6563},
    {
273.6962,-270.0783,1181.6563},
    {
264.3293,-272.1112,1181.6563},
    {
249.8487,-276.9585,1181.6563},
    {
248.4357,-271.3938,1181.6563},
    {
266.9960,-264.8860,1181.6563},
    {
260.7318,-261.3655,1181.6563},
    {
263.0797,-281.2147,1181.6563},
    {
278.5888,-276.6051,1181.6563},
    {
282.5634,-280.0367,1185.8195},
    {
281.7803,-269.3492,1185.8113},
    {
277.7030,-261.2810,1185.8113},
    {
275.4578,-261.2827,1185.8113},
    {
273.1691,-261.2846,1185.8113},
    {
268.9511,-261.2878,1185.8113},
    {
265.0761,-261.2909,1185.8113},
    {
258.1911,-261.2963,1185.8113}
};
new 
Float:rastgeleAdrenalinPickup[51][3] =
{
    {
263.9325,-271.1338,1181.6563},
    {
265.8892,-270.7938,1181.6563},
    {
268.0133,-269.7187,1181.6563},
    {
270.0383,-275.9179,1181.6563},
    {
272.8559,-274.4918,1181.6563},
    {
274.9379,-273.4380,1181.6563},
    {
276.6492,-262.8387,1181.6563},
    {
272.4637,-261.2182,1181.6563},
    {
262.9818,-275.2536,1181.6563},
    {
257.2866,-266.4196,1181.6563},
    {
251.3973,-276.3630,1181.6563},
    {
248.2588,-261.2187,1185.8173},
    {
253.8541,-261.0517,1185.8173},
    {
255.8856,-261.1027,1185.8173},
    {
260.3749,-261.4998,1185.8173},
    {
263.4521,-261.4211,1185.8173},
    {
283.9682,-260.8960,1185.8173},
    {
279.5124,-264.2802,1181.6563},
    {
267.3039,-258.2576,1181.6563},
    {
255.2964,-263.1861,1184.4354},
    {
249.5303,-261.3873,1185.8173},
    {
249.0952,-265.7135,1183.5509},
    {
247.9244,-282.3086,1181.6563},
    {
256.3747,-270.1659,1181.6563},
    {
271.4233,-272.0525,1181.6563},
    {
281.8883,-281.4579,1181.6563},
    {
279.4747,-277.5747,1185.8199},
    {
265.6163,-279.1992,1185.8235},
    {
252.8901,-279.3804,1185.8160},
    {
267.2919,-258.1317,1185.8203},
    {
271.5889,-261.2592,1185.8120},
    {
274.1129,-261.6598,1181.6563},
    {
262.7912,-265.6473,1181.6563},
    {
258.5964,-276.4184,1181.6563},
    {
273.9452,-274.8064,1181.6563},
    {
273.6962,-270.0783,1181.6563},
    {
264.3293,-272.1112,1181.6563},
    {
249.8487,-276.9585,1181.6563},
    {
248.4357,-271.3938,1181.6563},
    {
266.9960,-264.8860,1181.6563},
    {
260.7318,-261.3655,1181.6563},
    {
263.0797,-281.2147,1181.6563},
    {
278.5888,-276.6051,1181.6563},
    {
282.5634,-280.0367,1185.8195},
    {
281.7803,-269.3492,1185.8113},
    {
277.7030,-261.2810,1185.8113},
    {
275.4578,-261.2827,1185.8113},
    {
273.1691,-261.2846,1185.8113},
    {
268.9511,-261.2878,1185.8113},
    {
265.0761,-261.2909,1185.8113},
    {
258.1911,-261.2963,1185.8113}
};
public 
OnGameModeInit()
{
    new 
can_x random(sizeof(rastgeleCanPickup));
    new 
zirh_x random(sizeof(rastgeleZirhPickup));
    new 
para_x random(sizeof(rastgeleParaPickup));
    new 
X_x random(sizeof(rastgeleAdrenalinPickup));
    
pickup_can CreatePickup(12402rastgeleCanPickup[can_x][0], rastgeleCanPickup[can_x][1], rastgeleCanPickup[can_x][2]);
    
pickup_zirh CreatePickup(12422rastgeleZirhPickup[zirh_x][0], rastgeleZirhPickup[zirh_x][1], rastgeleZirhPickup[zirh_x][2]);
     
pickup_para CreatePickup(12742rastgeleParaPickup[para_x][0], rastgeleParaPickup[para_x][1], rastgeleParaPickup[para_x][2]);
    
pickup_uyusturucu CreatePickup(12412rastgeleAdrenalinPickup[X_x][0], rastgeleAdrenalinPickup[X_x][1], rastgeleAdrenalinPickup[X_x][2]);
    return 
1;

How can i do spawn pickups random pos when pickups spawn?

Thx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)