Server Unknown Command
#1

Guys i have problem.
Here is my script of DM zone and when i type /dm2 it says server unknows command. Why??
Код:
new PlayerJoinedDMZone2[MAX_PLAYERS];

new Float:DMSpawn2[][] =
{
	{1344.03149, -1555.18396, 84.54413},
	{1346.91528, -1541.32300, 85.99210},
	{1358.49268, -1547.67346, 85.99210}
};

        CreateObject(987, 1329.59949, -1535.53491, 84.28280,   0.00000, 0.00000, -6.06000);
 	CreateObject(987, 1341.53223, -1536.80017, 84.29880,   0.00000, 0.00000, -6.06000);
	CreateObject(987, 1326.87012, -1547.15991, 84.28280,   0.00000, 0.00000, 78.00000);
	CreateObject(987, 1353.40759, -1538.06140, 84.29880,   0.00000, 0.00000, -12.00000);
	CreateObject(987, 1363.02722, -1558.23059, 84.28280,   0.00000, 0.00000, -111.00000);
	CreateObject(987, 1324.35034, -1558.89343, 84.28280,   0.00000, 0.00000, 78.00000);
	CreateObject(987, 1335.94141, -1562.14966, 84.28280,   0.00000, 0.00000, -196.00000);
	CreateObject(987, 1347.02429, -1566.62524, 84.28280,   0.00000, 0.00000, -202.00000);
	CreateObject(987, 1358.63147, -1569.50134, 84.28280,   0.00000, 0.00000, -194.00000);
	CreateObject(987, 1366.10901, -1546.67578, 84.28280,   0.00000, 0.00000, -105.00000);
	CreateObject(987, 1367.64990, -1540.87622, 84.28280,   0.00000, 0.00000, -105.00000);
	CreateObject(987, 1356.23865, -1538.72705, 84.29880,   0.00000, 0.00000, -12.00000);
	CreateObject(3576, 1354.69836, -1548.55713, 84.54413,   0.00000, 0.00000, 0.00000);
	CreateObject(3576, 1344.03149, -1556.18396, 84.54413,   0.00000, 0.00000, 0.00000);
	CreateObject(3576, 1360.16479, -1553.20178, 84.54413,   0.00000, 0.00000, 0.00000);
	CreateObject(3576, 1353.19031, -1553.29993, 84.54413,   0.00000, 0.00000, 0.00000);
	CreateObject(3576, 1332.57678, -1549.01807, 84.54413,   0.00000, 0.00000, 0.00000);
	CreateObject(3576, 1343.77795, -1544.51233, 84.54413,   0.00000, 0.00000, 0.00000);
	CreateObject(3576, 1354.44763, -1563.16052, 85.99210,   0.00000, 0.00000, 0.00000);
	CreateObject(3576, 1346.87231, -1561.40234, 85.99210,   0.00000, 0.00000, 0.00000);
	CreateObject(3576, 1337.02771, -1546.40320, 85.99210,   0.00000, 0.00000, 0.00000);
	CreateObject(3576, 1330.26501, -1555.05884, 85.99210,   0.00000, 0.00000, 0.00000);
	CreateObject(3576, 1358.49268, -1545.67346, 85.99210,   0.00000, 0.00000, 0.00000);
	CreateObject(3576, 1340.36011, -1552.31201, 85.99210,   0.00000, 0.00000, 0.00000);
	CreateObject(3576, 1346.91528, -1542.32300, 85.99210,   0.00000, 0.00000, 0.00000);

CMD:dm2(playerid, params[])
{
	PlayerJoinedDMZone2[playerid] = 1;
   	new randomcoords = random(sizeof(DMSpawn));
   	SPP(playerid, DMSpawn2[randomcoords][0], DMSpawn2[randomcoords][1], DMSpawn2[randomcoords][2]);
	GivePlayerWeapon(playerid, 24, 100); //Deagle
	GivePlayerWeapon(playerid, 25, 100); //Shotgun
	GivePlayerWeapon(playerid, 26, 100); //Shawn Fff
	GivePlayerWeapon(playerid, 28, 500); //Uzi
	GivePlayerWeapon(playerid, 30, 100); //Ak 47
	GivePlayerWeapon(playerid, 31, 50);  //M4
	SetPlayerArmour(playerid, 100);
	SPH(playerid, 100);
	SCM(playerid, 0xF81414, "Dobrodosli u DM zonu. Srecno :)");
	return 1;
}
Why does it says ServerUnknowsCommand
Reply
#2

CreateObject codes shall be in the OnGameModeInit.
Reply
#3

I dont see any thing wrong in this cmd...
Reply
#4

I honestly don't see anything wrong with that command at all, as Kevin said, Object codes should be under OnGameModeInit but I also suppose you have that done too so I suggest adding this

pawn Код:
#pragma unused params

So it's like:
pawn Код:
CMD:dm2(playerid, params[])
{
    #pragma unused params

        PlayerJoinedDMZone2[playerid] = 1;
    new randomcoords = random(sizeof(DMSpawn));
    SPP(playerid, DMSpawn2[randomcoords][0], DMSpawn2[randomcoords][1], DMSpawn2[randomcoords][2]);
    GivePlayerWeapon(playerid, 24, 100); //Deagle
    GivePlayerWeapon(playerid, 25, 100); //Shotgun
    GivePlayerWeapon(playerid, 26, 100); //Shawn Fff
    GivePlayerWeapon(playerid, 28, 500); //Uzi
    GivePlayerWeapon(playerid, 30, 100); //Ak 47
    GivePlayerWeapon(playerid, 31, 50);  //M4
    SetPlayerArmour(playerid, 100);
    SPH(playerid, 100);
    SCM(playerid, 0xF81414, "Dobrodosli u DM zonu. Srecno :)");
    return 1;
}
I honestly can't find anything else wrong with that, but try this out and reply back I hope I am not wrong tho.

Cheers.
Reply
#5

Sure you include zcmd? i Had this problem once and it was the include..
Reply
#6

maybe replace this:
new randomcoords = random(sizeof(DMSpawn));

with this:

new randomcoords = random(sizeof(DMSpawn2));
Reply
#7

Thank you guys. I will try everything now and will send you feedback
Reply
#8

Okay. So @Bigwebicek fixed problem. Instead of (DMSpawn2)) I accidently wrote (DMSpawn)) Thank you guys ALL!! YOU ARE THE BEST :*
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)