SERVER: Unknown Command
#1

Код:
	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?
Reply
#2

add return 1;
Reply
#3

tried it but still the same effect
Reply
#4

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

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;
}
Reply
#6

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; } )
Reply
#7

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
Reply
#8

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;
}
Reply
#9

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)