Random Teleport
#1

Quote:

D:\Server\filterscripts\MyScript.pwn(96) : error 018: initialization data exceeds declared size
D:\Server\filterscripts\MyScript.pwn(162) : error 017: undefined symbol "Random"
D:\Server\filterscripts\MyScript.pwn(162) : warning 202: number of arguments does not match definition
D:\Server\filterscripts\MyScript.pwn(164) : error 032: array index out of bounds (variable "GalsTeleport")
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.

this is errors
and my script problem
Quote:

new Float:GalsTeleport[3][3] =
{
{1911.9089,-2296.0752,13.5469,263.6957},
{1908.9016,-2327.6499,13.5469,263.6957},
{1909.1213,-2350.7175,13.5469,263.6957}
};

Command
Quote:

dcmd_gals(playerid,params[])
{
#pragma unused params

new rand = Random(sizeof(GalsTeleport));
SetPlayerPos(playerid,GalsTeleport[rand][0],GalsTeleport[rand][1],GalsTeleport[rand][2]);
SetPlayerFacingAngle(playerid,GalsTeleport[rand][3]);
return 1;
}

help please
Reply
#2

Just as it says:
D:\Server\filterscripts\MyScript.pwn(162) : error 017: undefined symbol "Random"

Random does not exist. random does however.

Код:
dcmd_gals(playerid,params[])
{
#pragma unused params

new rand = random(sizeof(GalsTeleport));
SetPlayerPos(playerid,GalsTeleport[rand][0],GalsTeleport[rand][1],GalsTeleport[rand][2]);
SetPlayerFacingAngle(playerid,GalsTeleport[rand][3]);
return 1;
}

Also, you are reading and saving 4 values from the array(x,y,z, angle)
but you have only have space for 3 values in the array.

The array should look like this:
Код:
new Float:GalsTeleport[3][4] =
{
{1911.9089,-2296.0752,13.5469,263.6957},
{1908.9016,-2327.6499,13.5469,263.6957},
{1909.1213,-2350.7175,13.5469,263.6957}
};
Reply
#3

thx work now
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)