Why is that? [NOOB QUESTION]
#1

PHP код:
new Float:RandomSpawn[][4] =
{
    
// Positions, (X, Y, Z and Facing Angle)
    
{-2796.98541224.818020.5429192.0335},
    {-
2454.2170503.875930.0790267.2932},
    {-
2669.7322, -6.08746.132889.8853}
};
 
 
public 
OnPlayerSpawn(playerid)
{
    new 
rand random(sizeof(RandomSpawn));
 
    
// SetPlayerPos to the random spawn data
    
SetPlayerPos(playeridRandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
 
    
// SetPlayerFacingAngle to the random facing angle data
    
SetPlayerFacingAngle(playeridRandomSpawn[rand][3]);
    return 
1;

Here is the code, now, why do we insert two arrays
PHP код:
new Float:RandomSpawn[FONT="System"][][4][/FONT
Also, what is the use of the first array and how to differ it from the other?
Reply
#2

https://sampwiki.blast.hk/wiki/Float
Reply
#3

lol, what?
Reply
#4

Quote:
Originally Posted by iPLEOMAX
Note: If you declare a string with no size, the precompiler will automatically set the size according to what you have initialized it with.
Example:

Код:
new something[] = "YAY!"; 
//it becomes:
new something[5] = "YAY!";
https://sampforum.blast.hk/showthread.php?tid=318212
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)