View Single Post
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 05-30-2013 , 01:26   Re: Random map locations
Reply With Quote #4

However this giving various errors, but have not found the error.

PHP Code:
Create()
{
    new 
Float:FVec[3];
    
GetRandomFlarePostion(FVec[]);

    new 
RFEnt CreateEntityByName("light_dynamic");
    
DispatchKeyValueFloat(RFEnt"spotlight_radius"400.0);
    
DispatchKeyValueFloat(RFEnt"distance"1000.0);
    
Format(corsizeof(cor), "%140 95 203 255"); 
    
DispatchKeyValue(RFEnt"_light"cor); 
    
DispatchKeyValue(RFEnt"brightness""1"); 
    
DispatchKeyValue(RFEnt"style""1");  
    
DispatchSpawn(RFEnt);
    
TeleportEntity(RFEntFVecNULL_VECTORNULL_VECTOR);
    
AcceptEntityInput(RFEnt"TurnOn");
}

stock GetRandomFlarePostion(FVec[])
{
    new 
Float:vec1 GetRandomInt(0999);
    new 
Float:vec2 GetRandomInt(0999);
    new 
Float:vec3 GetRandomFloat(10.020.0);

    if(
vec1 == vec3 && vec1 == vec2 && vec3 == vec2)
    {
        
GetRandomFlarePostion(FVec);
    }
    else if(
TR_PointOutsideWorld(FVec[3])
    {
        
GetRandomFlarePostion(FVec);
    }
    else 
    {
        
FVec[0] = vec1;
        
FVec[1] = vec2;
        
FVec[2] = vec3;
    } 
Thanks for help.
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM
rodrigo286 is offline