SetSpawnInfo
#1

I have an argument error.

PHP код:
SetSpawnInfo(playerid0pInfo[playerid][pSkin], HumanSpawns[random(10)], HumanSpawns[random(10)], HumanSpawns[random(10)], HumanSpawns[random(10)], pInfo[playerid][pWeap1], pInfo[playerid][pAmmo1], pInfo[playerid][pWeap2], pInfo[playerid][pAmmo2], pInfo[playerid][pWeap3], pInfo[playerid][pAmmo3]); 
EDIT: Here's HumanSpawns

PHP код:
new Float:HumanSpawns[10][4] =
{
    {-
1935.0742,678.1586,46.5625,356.4240}, 
    {-
1922.5177,680.0504,46.5625,2.6907},
    {-
1934.6843,264.8631,41.0469,276.9846},
    {-
2022.3842,155.8002,28.8359,266.6432},
    {-
2314.1555,-169.0953,35.3203,178.2457},
    {-
2126.3633,-383.9755,35.3359,2.5950},
    {-
2720.4807,-317.9581,7.8438,41.5845},
    {-
2521.2214,-621.2564,132.7300,1.2376},
    {-
1928.7382,-790.2328,32.1506,273.2949},
    {-
1953.3707,1339.3734,7.1875,174.4267}
}; 
Reply
#2

Two dimensional array - you need to specify your choice
new array[x][y] = X;
array[x] = UNKNOWN;
You need to add [y] to your array.
Here is a fixed code:
PHP код:
new rand random(sizeof(HumanSpawns));
SetSpawnInfo(playerid0pInfo[playerid][pSkin], HumanSpawns[random][0], HumanSpawns[random][1], HumanSpawns[random][2], HumanSpawns[random][3], pInfo[playerid][pWeap1], pInfo[playerid][pAmmo1], pInfo[playerid][pWeap2], pInfo[playerid][pAmmo2], pInfo[playerid][pWeap3], pInfo[playerid][pAmmo3]); 
Reply
#3

Quote:
Originally Posted by NeXoR
Посмотреть сообщение
Two dimensional array - you need to specify your choice
new array[x][y] = X;
array[x] = UNKNOWN;
You need to add [y] to your array.
Here is a fixed code:
PHP код:
new rand random(sizeof(HumanSpawns));
SetSpawnInfo(playerid0pInfo[playerid][pSkin], HumanSpawns[random][0], HumanSpawns[random][1], HumanSpawns[random][2], HumanSpawns[random][3], pInfo[playerid][pWeap1], pInfo[playerid][pAmmo1], pInfo[playerid][pWeap2], pInfo[playerid][pAmmo2], pInfo[playerid][pWeap3], pInfo[playerid][pAmmo3]); 
We didn't use the variable rand. So it should be HumanSpawns[rand][0] and so on and so forth, right?
Reply
#4

Quote:
Originally Posted by NealPeteros
Посмотреть сообщение
We didn't use the variable rand. So it should be HumanSpawns[rand][0] and so on and so forth, right?
Oh yeah, my mistake, rand instead of random
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)