SA-MP Forums Archive
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)
+--- Thread: Unknown Command (/showthread.php?tid=298180)



Unknown Command - omer5198 - 19.11.2011

i built this command:
pawn Код:
if(strcmp(cmd, "/CAR", true) == 0)
    {
        if(!IsPlayerAdmin(playerid) && PlayerInfo[playerid][AdminLevel] < 2) return SendClientMessage(playerid, COLOR_RED, "аъд зййб мдйеъ мфзеъ агойп шод 2 бщбйм мдщъощ бфчегд же");
        tmp = strtok(cmdtext, idx);
        tmp2 = strtok(cmdtext, idx);
        tmp3 = strtok(cmdtext, idx);
        GetPlayerPos(playerid, x, y, z);
        if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_ORANGE, "/CAR [Model] [Primary Color *Optional*] [Secondery Color *Optional*]");
        if(!strlen(tmp2))
        {
            Car[playerid] = AddStaticVehicle(strval(tmp), x, y, z, a, -1, -1);
            format(string, sizeof(string), "{FF0000}Random | Random{FFFF00} бцбтйн {FF0000}(ID:%d){FFFFFF} /%s/{FFFF00} жйоръ мтцок аъ дшлб", strval(tmp), VehNames[GetVehicleModel(strval(tmp)) - 400]);
            SendClientMessage(playerid, COLOR_YELLOW, string);
            PutPlayerInVehicle(playerid, Car[playerid], 0);
            return 1;
        }
        if(!strlen(tmp3))
        {
            Car[playerid] = AddStaticVehicle(strval(tmp), x, y, z, a, strval(tmp2), -1);
            format(string, sizeof(string), "{FF0000}%d | Random{FFFF00} бцбтйн {FF0000}(ID:%d){FFFFFF} /%s/{FFFF00} жйоръ мтцок аъ дшлб", strval(tmp2), strval(tmp), VehNames[GetVehicleModel(strval(tmp)) - 400]);
            SendClientMessage(playerid, COLOR_YELLOW, string);
            PutPlayerInVehicle(playerid, Car[playerid], 0);
            return 1;
        }
        Car[playerid] = AddStaticVehicle(strval(tmp), x, y, z, a, strval(tmp2), strval(tmp3));
        format(string, sizeof(string), "{FF0000}%d | %d{FFFF00} бцбтйн {FF0000}(ID:%d){FFFFFF} /%s/{FFFF00} жйоръ мтцок аъ дшлб", strval(tmp2), strval(tmp3), strval(tmp), VehNames[GetVehicleModel(strval(tmp)) - 400]);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        PutPlayerInVehicle(playerid, Car[playerid], 0);
        return 1;
    }
i didn't found any problem with this code but i still get "Unkown Command" (Only with this command...)


Re: Unknown Command - omer5198 - 19.11.2011

anyone?


Re: Unknown Command - Jordiee - 19.11.2011

I only got one for zCMD, you can have that if you can convert it.


Re: Unknown Command - Tanush123 - 19.11.2011

pawn Код:
if (strcmp("/car", cmdtext, true, 10) == 0)



Re: Unknown Command - Kerlan - 19.11.2011

exactly


Re: Unknown Command - omer5198 - 20.11.2011

Quote:
Originally Posted by Kerlan
Посмотреть сообщение
exactly
you are spammer... :P
Quote:
Originally Posted by Tanush123
Посмотреть сообщение
pawn Код:
if (strcmp("/car", cmdtext, true, 10) == 0)
i didn't tried it because i don't see why this will work... i have a valid Strtok stok and i have the variable "cmd"... + i use this method in more commands and it works perfectly...


Re: Unknown Command - NessaHD - 20.11.2011

It's about the caps.. The cmd isn't variable if you don't type it with caps. Do it like Tanush123 showed you, it should be working. Your problem is causing that your command is /CAR, and you write /car. Try it, should work..


Re: Unknown Command - fiki574 - 20.11.2011

Quote:
Originally Posted by omer5198
Посмотреть сообщение
you are spammer... :P


i didn't tried it because i don't see why this will work... i have a valid Strtok stok and i have the variable "cmd"... + i use this method in more commands and it works perfectly...
Try it it will work! You missed 2 statements and thats important! Wont kill ya if ya try!


Re: Unknown Command - omer5198 - 20.11.2011

doesn't work :P


Re: Unknown Command - omer5198 - 20.11.2011

help please?