SERVER: Unknown Command
#1

Eh, I have been scripting for a while and I can't see no problem with this script, but when I do the command it says SERVER: Unknown Command...

pawn Код:
else if(!strcmp(cmdtext,"/knuckles",true))
    {
        GivePlayerWeapon(playerid, 1, 1);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself brass knuckles.");
    }
    else if(!strcmp(cmdtext,"/golfclub",true))
    {
        GivePlayerWeapon(playerid, 2, 1);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself brass knuckles.");
    }
    else if(!strcmp(cmdtext,"/nitestick",true))
    {
        GivePlayerWeapon(playerid, 3, 1);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a nitestick.");
    }
    else if(!strcmp(cmdtext,"/knife",true))
    {
        GivePlayerWeapon(playerid, 4, 1);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a knife.");
    }
    else if(!strcmp(cmdtext,"/bat",true))
    {
        GivePlayerWeapon(playerid, 5, 1);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a baseball bat.");
    }
    else if(!strcmp(cmdtext,"/shovel",true))
    {
        GivePlayerWeapon(playerid, 6, 1);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a shovel.");
    }
    else if(!strcmp(cmdtext,"/poolcue",true))
    {
        GivePlayerWeapon(playerid, 7, 1);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a pool cue.");
    }
    else if(!strcmp(cmdtext,"/katana",true))
    {
        GivePlayerWeapon(playerid, 8, 1);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a katana.");
    }
    else if(!strcmp(cmdtext,"/chainsaw",true))
    {
        GivePlayerWeapon(playerid, 9, 1);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a chainsaw.");
    }
    else if(!strcmp(cmdtext,"/grenade",true))
    {
        GivePlayerWeapon(playerid, 16, 50);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself 50 grenades.");
    }
    else if(!strcmp(cmdtext,"/molotov",true))
    {
        GivePlayerWeapon(playerid, 18, 50);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself 50 molotovs.");
    }
    else if(!strcmp(cmdtext,"/colt",true))
    {
        GivePlayerWeapon(playerid, 22, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a Colt 45.");
    }
    else if(!strcmp(cmdtext,"/silencer",true))
    {
        GivePlayerWeapon(playerid, 23, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a silenced pistol.");
    }
    else if(!strcmp(cmdtext,"/deagle",true))
    {
        GivePlayerWeapon(playerid, 24, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a desert eagle.");
    }
    else if(!strcmp(cmdtext,"/shotgun",true))
    {
        GivePlayerWeapon(playerid, 25, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a shotgun.");
    }
    else if(!strcmp(cmdtext,"/sawnoff",true))
    {
        GivePlayerWeapon(playerid, 26, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a sawnoff shotgun.");
    }
    else if(!strcmp(cmdtext,"/combat",true))
    {
        GivePlayerWeapon(playerid, 27, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a combat shotgun.");
    }
    else if(!strcmp(cmdtext,"/uzi",true))
    {
        GivePlayerWeapon(playerid, 28, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a mini uzi.");
    }
    else if(!strcmp(cmdtext,"/mp5",true))
    {
        GivePlayerWeapon(playerid, 29, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself an MP5.");
    }
    else if(!strcmp(cmdtext,"/ak47",true))
    {
        GivePlayerWeapon(playerid, 30, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a Colt 45.");
    }
    else if(!strcmp(cmdtext,"/m4",true))
    {
        GivePlayerWeapon(playerid, 31, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself an M4.");
    }
    else if(!strcmp(cmdtext,"/tec9",true))
    {
        GivePlayerWeapon(playerid, 32, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a Tec-9.");
    }
    else if(!strcmp(cmdtext,"/rifle",true))
    {
        GivePlayerWeapon(playerid, 33, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a country rifle.");
    }
    else if(!strcmp(cmdtext,"/sniper",true))
    {
        GivePlayerWeapon(playerid, 34, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a sniper.");
    }
    else if(!strcmp(cmdtext,"/para",true))
    {
        GivePlayerWeapon(playerid, 46, 1);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a parachute.");
    }
Reply
#2

Man, convert to ZCMD or YCMD. It's more efficient!
Reply
#3

Try returning it with return 1;
Reply
#4

Quote:
Originally Posted by Andregood
Посмотреть сообщение
Try returning it with return 1;
Thanks, will test it when I have time.
Reply
#5

pawn Код:
else if(!strcmp(cmdtext,"/knuckles",true))
    {
        GivePlayerWeapon(playerid, 1, 1);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself brass knuckles.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/golfclub",true))
    {
        GivePlayerWeapon(playerid, 2, 1);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself brass knuckles.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/nitestick",true))
    {
        GivePlayerWeapon(playerid, 3, 1);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a nitestick.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/knife",true))
    {
        GivePlayerWeapon(playerid, 4, 1);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a knife.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/bat",true))
    {
        GivePlayerWeapon(playerid, 5, 1);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a baseball bat.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/shovel",true))
    {
        GivePlayerWeapon(playerid, 6, 1);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a shovel.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/poolcue",true))
    {
        GivePlayerWeapon(playerid, 7, 1);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a pool cue.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/katana",true))
    {
        GivePlayerWeapon(playerid, 8, 1);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a katana.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/chainsaw",true))
    {
        GivePlayerWeapon(playerid, 9, 1);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a chainsaw.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/grenade",true))
    {
        GivePlayerWeapon(playerid, 16, 50);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself 50 grenades.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/molotov",true))
    {
        GivePlayerWeapon(playerid, 18, 50);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself 50 molotovs.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/colt",true))
    {
        GivePlayerWeapon(playerid, 22, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a Colt 45.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/silencer",true))
    {
        GivePlayerWeapon(playerid, 23, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a silenced pistol.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/deagle",true))
    {
        GivePlayerWeapon(playerid, 24, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a desert eagle.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/shotgun",true))
    {
        GivePlayerWeapon(playerid, 25, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a shotgun.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/sawnoff",true))
    {
        GivePlayerWeapon(playerid, 26, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a sawnoff shotgun.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/combat",true))
    {
        GivePlayerWeapon(playerid, 27, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a combat shotgun.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/uzi",true))
    {
        GivePlayerWeapon(playerid, 28, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a mini uzi.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/mp5",true))
    {
        GivePlayerWeapon(playerid, 29, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself an MP5.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/ak47",true))
    {
        GivePlayerWeapon(playerid, 30, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a Colt 45.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/m4",true))
    {
        GivePlayerWeapon(playerid, 31, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself an M4.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/tec9",true))
    {
        GivePlayerWeapon(playerid, 32, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a Tec-9.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/rifle",true))
    {
        GivePlayerWeapon(playerid, 33, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a country rifle.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/sniper",true))
    {
        GivePlayerWeapon(playerid, 34, 9999);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a sniper.");
        return 1;
    }
    else if(!strcmp(cmdtext,"/para",true))
    {
        GivePlayerWeapon(playerid, 46, 1);
        SendClientMessage(playerid,COLOR_GREY,"SERVER: You have just gave yourself a parachute.");
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)