ZCMD + Strcmp.
#1

Hey, I downloaded a login system filterscript. But it is coded with ZCMD. I am coding with strcmp.

So I made a few commands for myself and they are not working. The compiler says no errors but nothing works when I get in-game. So I noticed that zcmd cannot be with strcmp if you create commands. Since I don't know how zcmd works I would like to get a solution.
Reply
#2

Don't make zcmd commands in any callbacks. Make them at the bottom of the file or something. Also why use strcmp? It's slow as hell.
Reply
#3

That is what I ment. I am using strcmp because I am a starter. I am using it because I understand it.
Reply
#4

A started should know all ways to do a thing, but should be able to choose the best.
Anyway man, if you use zcmd you cant use strcmp too (i never tried it, but as you said..) so choose a way and continue with it.
Reply
#5

When I started, I found this:

pawn Код:
CMD:command_name(playerid, params[])
{
    //code here
    return 1;
}
easier than this:
pawn Код:
if(!strcmp(cmdtext, "/command_name", false))
{
    //code here
    return 1;
}
Reply
#6

Quote:
Originally Posted by thefatshizms
Посмотреть сообщение
When I started, I found this:

pawn Код:
CMD:command_name(playerid, params[])
{
    //code here
    return 1;
}
easier than this:
pawn Код:
if(!strcmp(cmdtext, "/command_name", false))
{
    //code here
    return 1;
}
True, or y_commands, it's more advanced, I jumped on it few weeks ago because of functionallity and I like it.

zClaw, what solution do you need? Because I see you don't know how to convert from ZCMD to STRCMP, so we need a one example command in ZCMD to convert it and give you an example of STRCMP use.
Reply
#7

Well, the filterscript is ZCMD. So I give you guys all the commands included.

pawn Код:
//====================ADMIN COMMANDS============================================
COMMAND:makeadmin(playerid, params[])
{
    new id;
    new AdminLevel2;
    if(IsPlayerConnected(id))
    {
        if(PlayerInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid))
        {
            if(!sscanf(params, "ui", id, AdminLevel2))
            {
                if((AdminLevel2 >= 1 && AdminLevel2 <= 5) || AdminLevel2 == 0)
                {
                    new string[64];
                    new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    GetPlayerName(id, PlayerName, sizeof(PlayerName));
                    format(string, sizeof(string), "%s has given you admin level %d.", name, AdminLevel2);
                    SendClientMessage(id, 0xD8D8D8FF, string);
                    format(string, sizeof(string), "You gave %d Admin Level to %s.", AdminLevel2, PlayerName);
                    SendClientMessage(playerid, 0xD8D8D8FF, string);
                    PlayerInfo[id][AdminLevel] = AdminLevel2;
                    return 1;
                }
                else return SendClientMessage(playerid, 0xD8D8D8FF, "Avaliable Levels: 1, 2, 3, 4 and 5.");
            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /makeadmin [PlayerId/PartOfName] [AdminLevel]");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "You have to be a Rcon Admin to use this command!");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected");
}
//==============================================================================
COMMAND:setskin(playerid, params[])
{
    new id;
    new skin1;
    if(IsPlayerConnected(id))
    {
        if(PlayerInfo[playerid][AdminLevel] >= 4)
        {
            if(!sscanf(params, "ui", id, skin1))
            {
                if((skin1 >= 0 && skin1 <= 200))
                {
                    new string[64];
                    new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    GetPlayerName(id, PlayerName, sizeof(PlayerName));
                    format(string, sizeof(string), "%s has set your skin to %d.", name, skin1);
                    SendClientMessage(id, 0xD8D8D8FF, string);
                    format(string, sizeof(string), "You gave skin %d to %s.", skin1, PlayerName);
                    SendClientMessage(playerid, 0xD8D8D8FF, string);
                    SetPlayerSkin(id, skin1);
                    return 1;
                }
                else return SendClientMessage(playerid, 0xD8D8D8FF, "Avaliable Levels: From 0 to 299");
            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /setskin [PlayerId/PartOfName] [SkinId]");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command.");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected");
}
//==============================================================================
COMMAND:setmoney(playerid, params[])
{
    new id;
    new ammount;
    if(IsPlayerConnected(id))
    {
        if(PlayerInfo[playerid][AdminLevel] >= 3)
        {
            if(!sscanf(params, "ui", id, ammount))
            {
                if(ammount <= 10000000000)
                {
                    new string[64];
                    new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    GetPlayerName(id, PlayerName, sizeof(PlayerName));
                    format(string, sizeof(string), "%s has given you %d.", name, ammount);
                    SendClientMessage(id, 0xD8D8D8FF, string);
                    format(string, sizeof(string), "You gave %d money to %s.", ammount, PlayerName);
                    SendClientMessage(playerid, 0xD8D8D8FF, string);
                    SetPlayerMoney(id, ammount);
                    return 1;
                }
                else return SendClientMessage(playerid, 0xD8D8D8FF, "You can't give so much");
            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /money [PlayerId/PartOfName] [Ammount]");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not admin 1338");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected.");
}
//==============================================================================
COMMAND:freeze(playerid, params[])
{
    if(PlayerInfo[playerid][AdminLevel] >= 1)
    {
        new id;
        if(!sscanf(params, "u", id))
        {
            if(IsPlayerConnected(id))
            {
                new Float:X, Float:Y, Float:Z;
                GetPlayerPos(playerid, X,Y,Z);
                if(IsPlayerInRangeOfPoint(id, 20.0, X,Y,Z))
                {
                    new string[64];
                    new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    GetPlayerName(id, PlayerName, sizeof(PlayerName));
                    format(string, sizeof(string), "You have been freezed by %s", name);
                    SendClientMessage(id, 0xD8D8D8FF, string);
                    format(string, sizeof(string), "You succesfully freezed %s", PlayerName);
                    SendClientMessage(playerid, 0xD8D8D8FF, string);
                    TogglePlayerControllable(id, 0);
                    return 1;
                }
                else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not near the player.");
            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not conected.");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /freeze [PlayerId/PartOfName]");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command.");
}
//==============================================================================
COMMAND:unfreeze(playerid, params[])
{
    if(PlayerInfo[playerid][AdminLevel] >=1)
    {
        new id;
        if(!sscanf(params, "u", id))
        {
            if(IsPlayerConnected(id))
            {
                new Float:X, Float:Y, Float:Z;
                GetPlayerPos(playerid, X,Y,Z);
                if(IsPlayerInRangeOfPoint(id, 20.0, X,Y,Z))
                {
                    new string[64];
                    new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    GetPlayerName(id, PlayerName, sizeof(PlayerName));
                    format(string, sizeof(string), "You have been unfreezed by %s", name);
                    SendClientMessage(id, 0xD8D8D8FF, string);
                    format(string, sizeof(string), "You unfreezed %s", PlayerName);
                    SendClientMessage(playerid, 0xD8D8D8FF, string);
                    TogglePlayerControllable(id, 1);
                    return 1;
                }
                else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not near the player.");
            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not conected.");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /unfreeze [PlayerId/PartOfName]");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command.");
}
//==============================================================================
COMMAND:ban(playerid, params[])
{
    new id;
    if(IsPlayerConnected(id))
    {
        if(PlayerInfo[playerid][AdminLevel] >= 3)
        {
            if(!sscanf(params, "u", id))
            {
                new string[64];
                new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                GetPlayerName(playerid, name, sizeof(name));
                GetPlayerName(id, PlayerName, sizeof(PlayerName));
                format(string, sizeof(string), "You have been banned by %s.", name);
                SendClientMessage(id, 0xD8D8D8FF, string);
                format(string, sizeof(string), "You banned %s.", id);
                SendClientMessage(playerid, 0xD8D8D8FF, string);
                Ban(id);
                return 1;
            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /ban [PlayerId/PartOfName]");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command.");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected.");
}
//==============================================================================
COMMAND:kick(playerid, params[])
{
    new id;
    if(IsPlayerConnected(id))
    {
        if(PlayerInfo[playerid][AdminLevel] >= 1)
        {
            if(!sscanf(params, "u", id))
            {
                new string[64];
                new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                GetPlayerName(playerid, name, sizeof(name));
                GetPlayerName(id, PlayerName, sizeof(PlayerName));
                format(string, sizeof(string), "You have been kicked by %s.", name);
                SendClientMessage(id, 0xD8D8D8FF, string);
                format(string, sizeof(string), "You kicked %s.", id);
                SendClientMessage(playerid, 0xD8D8D8FF, string);
                Kick(id);
                return 1;
            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /kick [PlayerId/PartOfName]");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command.");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected.");
}
//==============================================================================
COMMAND:setscore(playerid, params[])
{
    new id;
    new score;
    if(IsPlayerConnected(id))
    {
        if(PlayerInfo[playerid][AdminLevel] >= 3)
        {
            if(!sscanf(params, "ui", id, score))
            {
                if(score <= 1000)
                {
                    new string[64];
                    new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    GetPlayerName(id, PlayerName, sizeof(PlayerName));
                    format(string, sizeof(string), "Your score has been setted to %d by %s.", score, name);
                    SendClientMessage(id, 0xD8D8D8FF, string);
                    format(string, sizeof(string), "You setted %s score to %d.", PlayerName, score);
                    SendClientMessage(playerid, 0xD8D8D8FF, string);
                    SetPlayerScore(id, score);
                    return 1;
                }
                else return SendClientMessage(playerid, 0xD8D8D8FF, "You can't set more than 1000");
            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /setscore [PlayerId/PartOfName] [Score]");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command.");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected.");
}
//==============================================================================
COMMAND:gotoid(playerid, params[])
{
    new id;
    if(IsPlayerConnected(id))
    {
        if(PlayerInfo[playerid][AdminLevel] >= 4)
        {
            if(!sscanf(params, "ui", id))
            {
                new string[64];
                new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                new Float:x, Float:y, Float:z;  GetPlayerPos(id,x,y,z); SetPlayerInterior(playerid,GetPlayerInterior(id));
                GetPlayerName(playerid, name, sizeof(name));
                GetPlayerName(id, PlayerName, sizeof(PlayerName));
                format(string, sizeof(string), "%s has teleported to you.", name);
                SendClientMessage(id, 0xD8D8D8FF, string);
                format(string, sizeof(string), "You teleported yourself to %s.", PlayerName);
                SendClientMessage(playerid, 0xD8D8D8FF, string);
                SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
                SetPlayerPos(playerid,x+2,y,z);
                return 1;
            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /goto [PlayerId/PartOfName]");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command.");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected.");
}
//==============================================================================
COMMAND:gethere(playerid, params[])
{
    new id;
    if(IsPlayerConnected(id))
    {
        if(PlayerInfo[playerid][AdminLevel] >= 4)
        {
            if(!sscanf(params, "ui", id))
            {
                new string[64];
                new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                new Float:x, Float:y, Float:z;  GetPlayerPos(playerid,x,y,z); SetPlayerInterior(id,GetPlayerInterior(playerid));
                GetPlayerName(playerid, name, sizeof(name));
                GetPlayerName(id, PlayerName, sizeof(PlayerName));
                format(string, sizeof(string), "%s teleported yourself to him.", name);
                SendClientMessage(id, 0xD8D8D8FF, string);
                format(string, sizeof(string), "You teleported %s to you.", PlayerName);
                SendClientMessage(playerid, 0xD8D8D8FF, string);
                SetPlayerVirtualWorld(id,GetPlayerVirtualWorld(playerid));
                SetPlayerPos(id,x+2,y,z);
                return 1;
            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /gethere[PlayerId/PartOfName]");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command.");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected.");
}
//==============================================================================
COMMAND:akill(playerid, params[])
{
    new id;
    if(IsPlayerConnected(id))
    {
        if(PlayerInfo[playerid][AdminLevel] >= 4)
        {
            if(!sscanf(params, "u", id))
            {
                new string[64];
                new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                GetPlayerName(playerid, name, sizeof(name));
                GetPlayerName(id, PlayerName, sizeof(PlayerName));
                format(string, sizeof(string), "You have been killed by %s.", name);
                SendClientMessage(id, 0xD8D8D8FF, string);
                format(string, sizeof(string), "You killed %s.", PlayerName);
                SendClientMessage(playerid, 0xD8D8D8FF, string);
                SetPlayerHealth(id, 0);
                return 1;
            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /akill [PlayerId/PartOfName]");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command.");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected.");
}
//==============================================================================
COMMAND:clearchat(playerid, params[])
{
    for(new i = 0; i < 50; i++) SendClientMessageToAll(0x33FF33AA," ");
    return 1;
}
//==============================================================================
//==============================================================================
COMMAND:setint(playerid, params[])
{
    new id;
    new interior;
    if(IsPlayerConnected(id))
    {
        if(PlayerInfo[playerid][AdminLevel] >= 1)
        {
            if(!sscanf(params, "ui", id, interior))
            {
                if(interior <= 100)
                {
                    new string[64];
                    new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    GetPlayerName(id, PlayerName, sizeof(PlayerName));
                    format(string, sizeof(string), "Your interior has been setted to %d by %s.", interior, name);
                    SendClientMessage(id, 0xD8D8D8FF, string);
                    format(string, sizeof(string), "You setted %s interior to %d.", PlayerName, interior);
                    SendClientMessage(playerid, 0xD8D8D8FF, string);
                    SetPlayerInterior(id, interior);
                    return 1;
                }
                else return SendClientMessage(playerid, 0xD8D8D8FF, "Invalid Interior Id");
            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /setint [PlayerId/PartOfName] [Interior]");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command.");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected.");
}
//==============================================================================
COMMAND:setvw(playerid, params[])
{
    new id;
    new virtualworld;
    if(IsPlayerConnected(id))
    {
        if(PlayerInfo[playerid][AdminLevel] >= 1)
        {
            if(!sscanf(params, "ui", id, virtualworld))
            {
                if(virtualworld <= 100)
                {
                    new string[64];
                    new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    GetPlayerName(id, PlayerName, sizeof(PlayerName));
                    format(string, sizeof(string), "Your virtual world has been setted to %d by %s.", virtualworld, name);
                    SendClientMessage(id, 0xD8D8D8FF, string);
                    format(string, sizeof(string), "You setted %s virtual world to %d.", PlayerName, virtualworld);
                    SendClientMessage(playerid, 0xD8D8D8FF, string);
                    SetPlayerVirtualWorld(id, virtualworld);
                    return 1;
                }
                else return SendClientMessage(playerid, 0xD8D8D8FF, "Invalid Virtual World Id");
            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /setvw [PlayerId/PartOfName] [VirtualWorld]");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command.");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected.");
}
//==============================================================================
COMMAND:giveweapon(playerid, params[])
{
    new id;
    new weap;
    new ammo;
    if(IsPlayerConnected(id))
    {
        if(PlayerInfo[playerid][AdminLevel] >= 4)
        {
            if(!sscanf(params, "uii", id, weap, ammo))
            {
                if(weap >= 1 && weap <= 46)
                {
                    if(ammo >= 1 && ammo <= 5000)
                    {
                        new string[64];
                        new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, name, sizeof(name));
                        GetPlayerName(id, PlayerName, sizeof(PlayerName));
                        format(string, sizeof(string), "%s has given you weapon %d with %d ammo.", name, weap, ammo);
                        SendClientMessage(id, 0xD8D8D8FF, string);
                        format(string, sizeof(string), "You gave weapon %d with %d ammo to %s .", weap, ammo, PlayerName);
                        SendClientMessage(playerid, 0xD8D8D8FF, string);
                        GivePlayerWeapon(id, weap, ammo);
                        return 1;
                    }
                    else return SendClientMessage(playerid, 0xD8D8D8FF, "Max ammo is 5000");
                }
                else return SendClientMessage(playerid, 0xD8D8D8FF, "Invalid weapon id!");

            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /giveweapon[PlayerId/PartOfName] [WeaponId] [Ammo]"),
            SendClientMessage(playerid, 0xD8D8D8FF, "1(Brass) 2(Nite) 3(Club) 4(knife) 5(bat) 6(Shovel) 7(Cue) 8(Katana) 9(Chainsaw) 10-13(Dildo)"),
            SendClientMessage(playerid, 0xD8D8D8FF, "14(Flowers) 15(Cane) 16(Grenades) 17(Teargas) 18(Molotovs) 22(Pistol) 23(SPistol) 24(Eagle)"),
            SendClientMessage(playerid, 0xD8D8D8FF, "25(Shotgun) 26(sawn-off) 27(Combat) 28(TEC9) 29(MP5) 30(AK47) 31(M4) 32(MAC10) 33(Country)"),
            SendClientMessage(playerid, 0xD8D8D8FF, "34(Sniper) 35(RPG) 37(Flamethrower) 38(Minigun) 41(spray) 42(exting) 43(Camera) 46(Parachute)");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "You need to be a Rcon Admin to use this command!");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected");
}
//==============================================================================
COMMAND:warn(playerid, params[])
{
    new id;
    if(IsPlayerConnected(id))
    {
        if(PlayerInfo[playerid][AdminLevel] >= 3)
        {
            if(!sscanf(params, "u", id))
            {
                new string[64];
                new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                GetPlayerName(playerid, name, sizeof(name));
                GetPlayerName(id, PlayerName, sizeof(PlayerName));
                format(string, sizeof(string), "You have been warned by %s.", name);
                SendClientMessage(id, 0xD8D8D8FF, string);
                format(string, sizeof(string), "You have warn %s.", PlayerName);
                SendClientMessage(playerid, 0xD8D8D8FF, string);
                PlayerInfo[playerid][pWarns] = PlayerInfo[playerid][pWarns] +1;
                return 1;
            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /warn1 [PlayerId/PartOfName]");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command.");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected.");
}
//==============================================================================
COMMAND:getmoney(playerid, params[])
{
    new id;
    new money;
    if(PlayerInfo[playerid][AdminLevel] >= 2)
    {
        if(!sscanf(params, "ui", id, money))
        {
            new string[64];
            new PlayerName[MAX_PLAYER_NAME];
            money = GetPlayerMoney(id);
            GetPlayerName(id, PlayerName, sizeof(PlayerName));
            format(string, sizeof(string), "%s has %d money.", id, money);
            SendClientMessage(id, 0xD8D8D8FF, string);
            return 1;
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /getmoney [PlayerId/PartOfName]");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command.");
}
//==============================================================================
COMMAND:spawncar(playerid, params[])
{
    if(PlayerInfo[playerid][AdminLevel] >= 3)
    {
        new carid, carcolor1, carcolor2;
        if(!sscanf(params, "iii", carid, carcolor1, carcolor2))
        {
            if(carid >= 400 && carid <= 611)
            {
                if(carcolor1 >= 0 && carcolor1 <= 252)
                {
                    if(carcolor2 >= 0 && carcolor2 <= 252)
                    {
                        new Float:X, Float:Y, Float:Z;
                        GetPlayerPos(playerid, X, Y, Z);
                        CreateVehicle(carid, X+4, Y, Z, 10, carcolor1, carcolor2, 100);
                        SendClientMessage(playerid, 0xD8D8D8FF, "Vehicle Spawned.");
                        return 1;
                    }
                    else return SendClientMessage(playerid, 0xD8D8D8FF, "Only color id's between 0 and 252 are avaliable.");
                }
                else return SendClientMessage(playerid, 0xD8D8D8FF, "Only color id's between 0 and 252 are avaliable.");
            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "Only id's between 400 and 611 are avaliable.");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /spawncar [VehicleId] [Color 1][Color 2]");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command.");
}
//==============================================================================
Reply
#8

Alright, give me a one more detail.. do you use sscanf2? Because now you gave us a code in ZCMD with sscanf2, but we don't know about yours, you might use strtok.
Reply
#9

Quote:
Originally Posted by Riddick94
Посмотреть сообщение
Alright, give me a one more detail.. do you use sscanf2? Because now you gave us a code in ZCMD with sscanf2, but we don't know about yours, you might use strtok.
I really have no idea. I have no idea where you're talking about. This is all the commands that the filterscript got.
I forgot who made it since he did not put the credits in the script.

How do I find out?
Reply
#10

Quote:
Originally Posted by zClaw
Посмотреть сообщение
I really have no idea. I have no idea where you're talking about. This is all the commands that the filterscript got.
I forgot who made it since he did not put the credits in the script.

How do I find out?
If you're using string compare to check a command, then you have to use something to make parameter(s) for commands. Are you using sscanf just like I see in ZCMD commands above?

i.e.
pawn Код:
if(!sscanf(params, "ui", id, AdminLevel2))
            {
or you're using strtok?

https://sampwiki.blast.hk/wiki/Strtok
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)