Unknown Command
#1

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...)
Reply
#2

anyone?
Reply
#3

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

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

exactly
Reply
#6

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

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

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!
Reply
#9

doesn't work :P
Reply
#10

help please?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)