SA-MP Forums Archive
Randon checkpoint map - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Randon checkpoint map (/showthread.php?tid=605746)



Randon checkpoint map - AtomicSAMP - 24.04.2016

How do I create a random checkpoint to put anywhere on the map?


Re: Randon checkpoint map - colonel-top - 24.04.2016

Random Wiki https://sampwiki.blast.hk/wiki/Random


Re: Randon checkpoint map - AbyssMorgan - 24.04.2016

PHP код:
stock GetRandomPointInCube(Float:minx,Float:miny,Float:minz,Float:maxx,Float:maxy,Float:maxz,&Float:x,&Float:y,&Float:z){
    new 
cx,cy,cz;
    
cx floatround(floatsqroot(floatpower(minx-maxx,2)))+1;
    
cy floatround(floatsqroot(floatpower(miny-maxy,2)))+1;
    
cz floatround(floatsqroot(floatpower(minz-maxz,2)))+1;
    
random(cx)+minx;
    
random(cy)+miny;
    
random(cz)+minz;
}


stock GetRandomCPPos(&Float:x,&Float:y,&Float:z){
    while(
== 0.0){
        
GetRandomPointInCube(-3000.0,-3000.0,0.0,3000.0,3000.0,1.0,x,y,z);
        
MapAndreas_FindZ_For2DCoord(x,y,z);
    }
    
+= 1.0;




Re: Randon checkpoint map - Kenxxx - 24.04.2016

https://sampforum.blast.hk/showthread.php?tid=162488

Here are some examples.