Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include a_samp
- #include mapandreas // http://forum.sa-mp.com/showthread.php?t=275492
- forward RandomSpawn(pid, freeze);
- public OnFilterScriptInit()
- {
- new time = gettime();
- MapAndreas_Init(MAP_ANDREAS_MODE_FULL);
- printf(" RandomSpawn loaded - took %d seconds.", gettime() - time);
- }
- public RandomSpawn(pid, freeze)
- {
- if(freeze) TogglePlayerControllable(pid, 0);
- new
- Float:pos[3],
- x=random(4000)-2000,
- y=random(4000)-2000,
- Float:z;
- for(new a; a < 100; a++)
- {
- MapAndreas_FindZ_For2DCoord(x, y, z);
- if(z >= 5.0 && z < 30.0)
- {
- pos[0] = x;
- pos[1] = y;
- pos[2] = z;
- SetPlayerPos(pid, x, y, z);
- break;
- }
- }
- if(freeze) TogglePlayerControllable(pid, 1);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement