Problem +1 rep for help
#1

Quote:

if(strcmp(cmd, "/maddogdm", true) == 0)
{
if(indeathmatch[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "Type /kill to leave the DM FIRST.");
return 1;
}
else
{
new Float:maddogspawn[9][3] =
{
// Positions, (X, Y, Z and Facing Angle)
{1266.3718,-780.3331,1084.0078},
{1253.6959,-786.6283,1084.0149},
{1268.9158,-786.1834,1084.0149},
{1266.7693,-809.4655,1084.0078},
{1234.0151,-811.4605,1084.0078},
{1275.4358,-826.8328,1085.6328},
{1280.6829,-815.3812,1089.9375},
{1283.4325,-785.7381,1089.9375},
{1278.5106,-772.6031,1091.9063}
};
new rand = random(sizeof(maddogspawn));
SetPlayerPos(playerid,maddogspawn[rand][0],maddogspawn[rand][1],maddogspawn[rand][2],maddogspawn[rand][3],maddogspawn[rand][4],maddogspawn[rand][5],maddogspawn[rand][6],maddogspawn[rand][7],maddogspawn[rand][8]);

Thats part of my script that doesnt work.

The full part
Quote:

if(strcmp(cmd, "/maddogdm", true) == 0)
{
if(indeathmatch[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "Type /kill to leave the DM FIRST.");
return 1;
}
else
{
new Float:maddogspawn[9][3] =
{
// Positions, (X, Y, Z and Facing Angle)
{1266.3718,-780.3331,1084.0078},
{1253.6959,-786.6283,1084.0149},
{1268.9158,-786.1834,1084.0149},
{1266.7693,-809.4655,1084.0078},
{1234.0151,-811.4605,1084.0078},
{1275.4358,-826.8328,1085.6328},
{1280.6829,-815.3812,1089.9375},
{1283.4325,-785.7381,1089.9375},
{1278.5106,-772.6031,1091.9063}
};
new rand = random(sizeof(maddogspawn));
SetPlayerPos(playerid,maddogspawn[rand][0],maddogspawn[rand][1],maddogspawn[rand][2],maddogspawn[rand][3],maddogspawn[rand][4],maddogspawn[rand][5],maddogspawn[rand][6],maddogspawn[rand][7],maddogspawn[rand][8]);
SetPlayerInterior(playerid, 5);
SendClientMessage(playerid, COLOR_RED, "------------Mad Dogs DM------------");
SendClientMessage(playerid, COLOR_GREEN, "Welcome to Maddogdm");
SendClientMessage(playerid, COLOR_RED, "----------------------------");
format(string,sizeof(string),"%s (Id:%d) Has Teleported to MadDogDM! (/maddogdm)",PlayerName,playerid);
SendClientMessageToAll(COLOR_GREEN, "string");
SetPlayerPos(playerid, 1299.14,-794.77,1084.00);
indeathmatch[playerid] = 1;
return 1;
}
}

Thats where it comes from. It all works perfectly but the random spawn.
When i try and compile i get this one error.

Quote:

(200) : error 032: array index out of bounds (variable "maddogspawn")

How do i fix this?

Thanks, if you can help me
Reply


Messages In This Thread
Problem +1 rep for help - by KingyKings - 25.07.2012, 09:16
Re: Problem +1 rep for help - by Jstylezzz - 25.07.2012, 09:21
Re: Problem +1 rep for help - by KingyKings - 25.07.2012, 09:33
Re: Problem +1 rep for help - by Jstylezzz - 25.07.2012, 09:34
Re: Problem +1 rep for help - by KingyKings - 25.07.2012, 09:39

Forum Jump:


Users browsing this thread: 1 Guest(s)