weird errors :S
#1

im trying to make player will spawn at those x y z at OnPlayerSpawn but i got errors
pawn Код:
D:\Users\Tanush\Desktop\SA-MP\gamemodes\stunt.pwn(77) : error 018: initialization data exceeds declared size
D:\Users\Tanush\Desktop\SA-MP\gamemodes\stunt.pwn(1165) : error 032: array index out of bounds (variable "spawn")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase
pawn Код:
new Float:spawn[][2] =
{
    {404.1312,2452.7603,16.5000},
    {1852.3341,-2547.9702,13.5469}
};
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerInterior(playerid,0);
    new ran = random(sizeof(spawn));//This funtion "random(max)" will give a random number of what is put there.
    SetPlayerPos(playerid,spawn[ran][0],spawn[ran][1],spawn[ran][2]);
    SetPlayerFacingAngle(playerid,357.2612);
    return 1;
}
first error line
pawn Код:
{
second error line
pawn Код:
SetPlayerPos(playerid,spawn[ran][0],spawn[ran][1],spawn[ran][2]);
Reply


Messages In This Thread
weird errors :S - by tanush - 03.04.2011, 21:24
Re: weird errors :S - by Marricio - 03.04.2011, 21:28
Re: weird errors :S - by ~Yoshi - 03.04.2011, 21:29
Re: weird errors :S - by tanush - 03.04.2011, 21:35
Re: weird errors :S - by airsoft - 04.04.2011, 01:27
Re: weird errors :S - by tanush - 04.04.2011, 19:12

Forum Jump:


Users browsing this thread: 1 Guest(s)