Posts: 3,324
	Threads: 96
	Joined: Sep 2013
	
	
 
	
	
		That looks ok as long as you got the coords right.
pawn Код:
stock SetRandomSpawn(targetid) 
{
    //-2646.3206, -344.8202; Bottom-Left
    //-2274.9263, -213.2971; Top-Right
    //X = Random(width) + Left
    //Y = Random(length) + Bottom
    new Float:x = float(random(372) - 2646.3206), 
        Float:y = float(random(131) - 344.8202), 
        Float:Z; 
    MapAndreas_FindZ_For2DCoord(x, y, Z); 
    SetPlayerPos(targetid, x, y, Z); 
    return 1; 
}
 Though I'm too lazy to check the coords at the moment, it's nearly 3AM and I'm on my meds (drowsy as'f).
Edit: Fuck it, you dragged me in anyways! I corrected the coordinates. Psuedo'd it a bit in the comments.
	
		
	
 
 
	
	
	
		
	Posts: 547
	Threads: 57
	Joined: Dec 2010
	
	
 
	
	
		If it isn't giving off any errors, you can put it under OnPlayerSpawn
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetRandomSpawn(playerid);
    return 1;
}