[HELP]Message when an object spawn.
#4

do something like:

NOTE:You need the zone names,you can get them from here
https://sampforum.blast.hk/showthread.php?tid=27598

pawn Код:
//BEGINNING OF SCRIPT
new Float:SPSPawns[][3] = {
{-2225.3716,2326.9734,7.5469},
{-2747.8416,-315.7603,7.1952} };

stock GetPos2DZone(x,y,z, zone[], len)
{
        for(new i = 0; i != sizeof(gSAZones); i++ )
        {
                if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4])
                {
                    return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
                }
        }
        return 0;
}

public OnGameModeInit()
{
   SetTimer("ChangePickup",50000,1);//Put here the time between pickup position change
   return 1;
}

public ChangePickup();
{
     new rand = random(sizeof(SPSPawns));
     new zone[MAX_ZONE_NAME];
     new string[128];
     CreatePickup (1274,2,SPSPawns[rand][0], SPSPawns[rand][1], SPSPawns[rand][2])
     GetPos2DZone(SPSPawns[rand][0], SPSPawns[rand][1], SPSPawns[rand][2],zone,sizeof(zone));
     format(string,sizeof(string),"The pickup has spawned in %s",zone);
     SendClientMessageToAll(COLOR_WHITE,string);
     return 1;
}
I've tried to create a stock that gets the area by the pos,i didn't test it out but i hope it's working .
I told you what you need,what to do,now i guess it is gonna work xD
If it doesn't work,ill try to get some free time and make it by myself directly in your script cuz i made it in 1 minute now because im tired and i need to sleep xD

NOTE:You need to combine the Zone Name Fs with your GM!
Reply


Messages In This Thread
[HELP]Message when an object spawn. - by Nano_UY - 24.01.2011, 15:09
Re: [HELP]Message when an object spawn. - by SkizzoTrick - 24.01.2011, 15:19
Re: [HELP]Message when an object spawn. - by Nano_UY - 24.01.2011, 16:25
Re: [HELP]Message when an object spawn. - by SkizzoTrick - 24.01.2011, 19:22
Re: [HELP]Message when an object spawn. - by Nano_UY - 31.01.2011, 22:01
Re: [HELP]Message when an object spawn. - by Nano_UY - 01.02.2011, 16:43
Re: [HELP]Message when an object spawn. - by Nano_UY - 02.02.2011, 18:01
Re: [HELP]Message when an object spawn. - by Nano_UY - 04.02.2011, 02:33

Forum Jump:


Users browsing this thread: 4 Guest(s)