SA-MP Forums Archive
SERVER: Unknown Command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SERVER: Unknown Command (/showthread.php?tid=126683)



SERVER: Unknown Command - yoan103 - 09.02.2010

Код:
	if (strcmp("/test", cmdtext, true, 10) == 0)
	{
	if (IsPlayerInAnyVehicle(playerid)) {
	SetVehiclePos(GetPlayerVehicleID(playerid), 242.5267, 5267.5267, 6178.6327);
	}
	else {
	SetPlayerPos(playerid, 242.5267, 5267.5267, 6178.6327);
	}
	}
Works fine, teleports me with my vehicle but when i type /test it shows me SERVER: Unknown Command, and everything works fine, so what's wrong with it?


Re: SERVER: Unknown Command - ~Dangun! - 09.02.2010

add return 1;


Re: SERVER: Unknown Command - yoan103 - 09.02.2010

tried it but still the same effect


Re: SERVER: Unknown Command - [IB]Scorcher - 09.02.2010

Fix the indentation? Or is just like that as you posted it on the forum


Re: SERVER: Unknown Command - Fedee! - 09.02.2010

Try this
pawn Код:
if (strcmp("/test", cmdtext, true, 5) == 0)
{
    if (IsPlayerInAnyVehicle(playerid)) {
    SetVehiclePos(GetPlayerVehicleID(playerid), 242.5267, 5267.5267, 6178.6327);
    }
    else {
    SetPlayerPos(playerid, 242.5267, 5267.5267, 6178.6327);
    }
    return 1;
}



Re: SERVER: Unknown Command - yoan103 - 09.02.2010

The indentation is fine but i putted return 1; like someone else said and it fucked up my other commands(Yes i did add under return 1; } )


Re: SERVER: Unknown Command - yoan103 - 09.02.2010

Quote:
Originally Posted by Fedee!
Try this
pawn Код:
if (strcmp("/test", cmdtext, true, 5) == 0)
{
    if (IsPlayerInAnyVehicle(playerid)) {
    SetVehiclePos(GetPlayerVehicleID(playerid), 242.5267, 5267.5267, 6178.6327);
    }
    else {
    SetPlayerPos(playerid, 242.5267, 5267.5267, 6178.6327);
    }
    return 1;
}
SOLVED, Thanks dude


Re: SERVER: Unknown Command - Correlli - 09.02.2010

Simple:
pawn Код:
if(strcmp(cmdtext, "/test", true) == 0)
{
  if(IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid), 242.5267, 5267.5267, 6178.6327);
  else SetPlayerPos(playerid, 242.5267, 5267.5267, 6178.6327);
  return true;
}



Re: SERVER: Unknown Command - Fedee! - 09.02.2010

Quote:
Originally Posted by yoan103
Quote:
Originally Posted by Fedee!
Try this
pawn Код:
if (strcmp("/test", cmdtext, true, 5) == 0)
{
    if (IsPlayerInAnyVehicle(playerid)) {
    SetVehiclePos(GetPlayerVehicleID(playerid), 242.5267, 5267.5267, 6178.6327);
    }
    else {
    SetPlayerPos(playerid, 242.5267, 5267.5267, 6178.6327);
    }
    return 1;
}
SOLVED, Thanks dude
Your welcome