can't fix error 032: array index out of bounds
#6

I am going to make,that it will show weapons on player request class,that player will have if he spawn as that class.
Here's code:
Код:
// On the top
new playerclass[MAX_PLAYERS];
new Text:OPRQwnp[MAX_PLAYERS];

enum wnt
{
 	 WeaponNames[ 256 ]
}
new weaponnames[MAX_TEAMS][wnt]= {
{ "- Primary~n- Deagle(100)~n- Thirdly"},
{ "- Primary~n- Secondary~n- Thirdly"},
{ "- Primary~n- Secondary~n- Thirdly"},
{ "- Primary~n- Secondary~n- Thirdly"},
{ "- Primary~n- Secondary~n- Thirdly"},
{ "- Primary~n- Secondary~n- Thirdly"},
{ "- Primary~n- Secondary~n- Thirdly"},
{ "- Primary~n- Secondary~n- Thirdly"},
{ "- Primary~n- Secondary~n- Thirdly"},
{ "- Primary~n- Secondary~n- Thirdly"}
};

// On Player connects
    OPRQwnp[playerid] = TextDrawCreate(9.000000, 150.000000, "- Primary(100)");
    TextDrawBackgroundColor(OPRQwnp[playerid], 255);
    TextDrawFont(OPRQwnp[playerid], 1);
    TextDrawLetterSize(OPRQwnp[playerid], 0.500000, 1.000000);
    TextDrawColor(OPRQwnp[playerid], -1);
    TextDrawSetOutline(OPRQwnp[playerid], 0);
    TextDrawSetProportional(OPRQwnp[playerid], 1);
    TextDrawSetShadow(OPRQwnp[playerid], 1);

// On player request class
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerClass( playerid, classid );
    SetPlayerColor( playerid, COLOR_INACTIVE );
    PlayerPlaySound( playerid, 1068, 0.0, 0.0, 0.0 );
    
    switch(classid)
    {
       case 0:
       {
	playerclass[playerid]=1;
         SetPlayerPos(playerid,2772.5334,-2382.5310,18.9217);
         SetPlayerCameraPos(playerid,2776.8987,-2377.0911,18.9217);
         SetPlayerCameraLookAt(playerid,2772.5334,-2382.5310,18.9217);
         SetPlayerFacingAngle(playerid,294.2843);
         ApplyAnimation(playerid,"LOWRIDER", "RAP_B_Loop",4.0,1,1,1,1,1);
       }
    }
	new string[256];
	format(string,sizeof(string),"%s",weaponnames[playerclass[playerid]][wnt]);
	TextDrawSetString(OPRQwnp[playerid],string);
	TextDrawShowForPlayer(playerid,OPRQwnp[playerid]);
  return 1;
}
Reply


Messages In This Thread
can't fix error 032: array index out of bounds - by aqu - 19.01.2012, 18:44
Re: can't fix error 032: array index out of bounds - by Vince - 19.01.2012, 19:06
Re: can't fix error 032: array index out of bounds - by aqu - 19.01.2012, 19:12
Re: can't fix error 032: array index out of bounds - by MP2 - 19.01.2012, 19:28
Re: can't fix error 032: array index out of bounds - by aqu - 19.01.2012, 19:31
Re: can't fix error 032: array index out of bounds - by aqu - 19.01.2012, 19:35
Re: can't fix error 032: array index out of bounds - by Tannz0rz - 19.01.2012, 19:43
Re: can't fix error 032: array index out of bounds - by aqu - 19.01.2012, 19:47

Forum Jump:


Users browsing this thread: 2 Guest(s)