Randon checkpoint map
#1

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

Random Wiki https://sampwiki.blast.hk/wiki/Random
Reply
#3

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;

Reply
#4

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

Here are some examples.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)