03.04.2011, 21:24
im trying to make player will spawn at those x y z at OnPlayerSpawn but i got errors
first error line
second error line
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;
}
pawn Код:
{
pawn Код:
SetPlayerPos(playerid,spawn[ran][0],spawn[ran][1],spawn[ran][2]);