Commands
#1

I have very many commands in strcmp in my gamemode.

Is there any limit? Because some of them (with fully functional code) just appears as "Unknown Command" in my server..
Reply
#2

There is no limit for commands. You probably did something wrong if you see "Unknown command" text.
Reply
#3

Here's one cmd that doesnt work -

pawn Код:
if (!strcmp("/lvair", cmdtext, true) || !strcmp("/lv", cmdtext, true) || !strcmp("/las venturas airport", cmdtext, true))
    {
      if(IsPlayerInAnyVehicle(playerid)){
        SetVehiclePos(GetPlayerVehicleID(playerid), 1282.6499,1267.8385,10.8203);
        SetVehicleZAngle(GetPlayerVehicleID(playerid), 81.020889);
        LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);}
        if (!IsPlayerInAnyVehicle(playerid)) {
        SetPlayerPos(playerid,1282.6499,1267.8385,10.8203);
        SetPlayerFacingAngle(playerid, 81.020889);}
    ResetPlayerWeapons(playerid);
    new string[128];
        new playername[MAX_PLAYER_NAME];
        GetPlayerName(playerid,playername,sizeof(playername));
        format(string, sizeof(string), "%s has joined LV Airport ( /lvair )",playername);
        SendClientMessageToAll(COLOR_LIGHTBLUE,string);
        return 1;
        }
Reply
#4

Add debug messages to command and see where the problem appears.
Reply
#5

I did now, none of the 9 debug messages shows in my server.exe :O

Help?

EDIT: Changed the /lvair code to:

pawn Код:
if(strcmp("/lvair", cmdtext, true, 10) == 0)
    {
            if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                SetVehiclePos(GetPlayerVehicleID(playerid), 1282.6499,1267.8385,10.8203);
                SetVehicleZAngle(GetPlayerVehicleID(playerid), 81.020889);
                LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
        ResetPlayerWeapons(playerid);
                }
                else if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
                {
                    SetPlayerPos(playerid,1282.6499,1267.8385,10.8203);
                ResetPlayerWeapons(playerid);
                }
        new string[128];
            new playername[MAX_PLAYER_NAME];
            GetPlayerName(playerid,playername,sizeof(playername));
            format(string, sizeof(string), "%s has joined LV Airport ( /lvair )",playername);
            SendClientMessageToAll(COLOR_LIGHTBLUE,string);
            return 1;
        }
Still not working.
Reply
#6

* Bump..
Reply
#7

It could be a problem with the code above it. For instance, it is not exited correctly.
Reply
#8

The command over is like this

pawn Код:
if (strcmp("/aquasp", cmdtext, true) == 0)
      {
        SetPlayerPos(playerid,3242.927,-761.425,2.590);
        SetPlayerFacingAngle(playerid, 81.020889);
    RemovePlayerFromVehicle(playerid);
        ResetPlayerWeapons(playerid);
    new string[128];
        new playername[MAX_PLAYER_NAME];
        GetPlayerName(playerid,playername,sizeof(playername));
        format(string, sizeof(string), "%s has joined Aquasp ( /aquasp )",playername);
        SendClientMessageToAll(COLOR_LIGHTBLUE,string);
        return 1;
        }
//------------------------------------------------------------------------------
Reply
#9

Do like this to see where it stops working
pawn Код:
if(strcmp("/lvair", cmdtext, true, 10) == 0)
    {       SendClientMessageToAll(COLOR_LIGHTBLUE,"test1");
            if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                SendClientMessageToAll(COLOR_LIGHTBLUE,"test2");
                SetVehiclePos(GetPlayerVehicleID(playerid), 1282.6499,1267.8385,10.8203);
                SetVehicleZAngle(GetPlayerVehicleID(playerid), 81.020889);
                LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
        ResetPlayerWeapons(playerid);
                SendClientMessageToAll(COLOR_LIGHTBLUE,"test3");
                }
                else if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
                {
                    SendClientMessageToAll(COLOR_LIGHTBLUE,"test4");
                    SetPlayerPos(playerid,1282.6499,1267.8385,10.8203);
                ResetPlayerWeapons(playerid);
                SendClientMessageToAll(COLOR_LIGHTBLUE,"test5");
                }
            SendClientMessageToAll(COLOR_LIGHTBLUE,"test6");
        new string[128];
            new playername[MAX_PLAYER_NAME];
            GetPlayerName(playerid,playername,sizeof(playername));
            format(string, sizeof(string), "%s has joined LV Airport ( /lvair )",playername);
            SendClientMessageToAll(COLOR_LIGHTBLUE,string);
            SendClientMessageToAll(COLOR_LIGHTBLUE,"test7");
            return 1;
        }
Reply
#10

Ive already added debug msg's. They didnt show.

Btw, There is more than that command thats not working, my /aquasp and /xtreme and some more doesnt work either :O
Reply


Forum Jump:


Users browsing this thread: