[HELP] Unknown Command Error
#1

Код:
dcmd_exit(playerid,params[]) {
	#pragma unused params
	if(IsPlayerConnected(playerid) && PLAYERLIST_authed[playerid] == 1){
		for(new h = 0; h <= MAX_HOUSES; h++)
		{
		  if(PlayerToPoint(3.0, playerid, HousesCoords[HouseInfo[h][hLevel]][0], HousesCoords[HouseInfo[h][hLevel]][1], HousesCoords[HouseInfo[h][hLevel]][2]))
			{
			  TeleportPlayer(playerid, HouseInfo[h][hExitX], HouseInfo[h][hExitY], HouseInfo[h][hExitZ], 0, 0, 0);
			}
		}
	}
	return true;
}
When i use thuis command to teleport out of my house i do teleport out but it says Unknown Command. How do i fix this?
Reply
#2

bump
Reply
#3

I seriously have no idea why it send that message. Btw, try this, a little more efficient
pawn Код:
dcmd_exit(playerid,params[]) {
    #pragma unused params
    if(IsPlayerConnected(playerid) && PLAYERLIST_authed[playerid] == 1){
        for(new h = 0; h <= MAX_HOUSES; h++)
        {
          if(PlayerToPoint(3.0, playerid, HousesCoords[HouseInfo[h][hLevel]][0], HousesCoords[HouseInfo[h][hLevel]][1], HousesCoords[HouseInfo[h][hLevel]][2]))
            {
              TeleportPlayer(playerid, HouseInfo[h][hExitX], HouseInfo[h][hExitY], HouseInfo[h][hExitZ], 0, 0, 0);
              return 1;
            }
        }
    }
    return 1;
}
Reply
#4

Well when i use the command /exit now and i am not in the area i get the Unknown command error.

But when i am in the area i dont get the Unknown command Error.
Reply
#5

Most likely, one of your variables is calling a cell which is outside of the array's limit.

pawn Код:
new array[9000];
array[9001] = 5; //OVER NINE THOUSAAAAAAAND!
Reply
#6

the highest value i have set is a Float: set too 1478.3801
Reply
#7

Quote:
Originally Posted by Joe Staff
Most likely, one of your variables is calling a cell which is outside of the array's limit.

pawn Код:
new array[9000];
array[9001] = 5; //OVER NINE THOUSAAAAAAAND!
How can i tell?
Reply
#8

What's with this
HousesCoords[HouseInfo[h][hLevel]][0]
Shouldn't it be
HousesCoords[h][0]?
What if the house's level is 99 or something and you only have 32 houses?
Reply
#9

Код:
new Float:HousesCoords[13][3] = {
{222.9534, 1287.7649, 1082.1406},  // Sml - 1 bedroom
{261.0827, 1284.6899, 1080.2578},  // Sml - 1 bedroom
{260.6734, 1237.7909, 1084.2578},  // Sml - 1 bedroom
{376.7426, 1417.3226, 1081.3281},  // Sml - 1 bedroom
{295.2874, 1473.2769, 1080.2578},  // Med - 2 bedroom
{2270.1050, -1210.3917, 1047.5625}, // Med - 2 bedroom
{327.9431, 1478.3801, 1084.4375},  // Med - 2 bedroom
{447.1211, 1397.8444, 1084.3047},  // Med - 2 bedroom
{2196.0063, -1204.6326, 1049.0234}, // Lrg - 3 bedroom
{235.3416, 1187.2882, 1080.2578},  // Lrg - 3 bedroom
{490.9987, 1399.4164, 1080.2578},  // Lrg - 3 bedroom
{227.1212, 1114.1840, 1080.9972},  // Lrg - 4 bedroom
{225.6624, 1022.5345, 1084.0145}  // Xlrg - 4 bedrooms
};

HousesCoords[HouseInfo[h][hLevel]][0]
HouseInfo[h][hLevel]
is the Level of the house. So i would if i was in the 1'st house i would use the house level to get the coordinates from the array.
Reply
#10

Would that mess it up?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)