/ban on 3 languages
#1

This is my command for /ban

pawn Код:
CMD:ban(playerid, params[])
{
    if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid))
    {
        new tmp[256], tmp2[256], Index;
        tmp = strtok(params,Index), tmp2 = strtok(params,Index);

        if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "Napisi: /ban [ID] [razlog]");

        new kohde;
        kohde = strval(tmp);

        if(!strlen(tmp2)) return SendClientMessage(playerid, COLOR_RED, "Napisi: /ban [ID] [razlog]");


        if(!IsPlayerConnected(kohde)) return SendClientMessage(playerid, COLOR_RED, "Netocan ID");

        new string[128];
        format(string, sizeof(string), "BAN: %s Je banan sa servera. (razlog: %s)", PlayerName(kohde), params[2]);
        SendClientMessageToAll(COLOR_RED, string);

        return BanEx(kohde, string);
    }
    return 1;
}
How is it possible to make each player involved to check the language

I tried this way

pawn Код:
CMD:ban(playerid, params[])
{
    if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid))
    {
        new tmp[256], tmp2[256], Index;
        tmp = strtok(params,Index), tmp2 = strtok(params,Index);

        if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "Napisi: /ban [ID] [razlog]");

        new kohde;
        kohde = strval(tmp);

        if(!strlen(tmp2)) return SendClientMessage(playerid, COLOR_RED, "Napisi: /ban [ID] [razlog]");


        if(!IsPlayerConnected(kohde)) return SendClientMessage(playerid, COLOR_RED, "Netocan ID");

        if(IsPlayerConnected(i))
        {
            if (IgracInfo[playerid][Jezik] == 1)
            {
            new string[128];
            format(string, sizeof(string), "BAN: %s e baniran. (pricina: %s)", PlayerName(kohde), params[2]);
            SendClientMessageToAll(COLOR_RED, string);
            }
            if (IgracInfo[playerid][Jezik] == 2)
            {
            new string[128];
            format(string, sizeof(string), "BAN: %s Je banan sa servera. (razlog: %s)", PlayerName(kohde), params[2]);
            SendClientMessageToAll(COLOR_RED, string);
            }
            if (IgracInfo[playerid][Jezik] == 3)
            {
            new string[128];
            format(string, sizeof(string), "BAN: %s is banned. (%s)", PlayerName(kohde), params[2]);
            SendClientMessageToAll(COLOR_RED, string);
            }
        }
        return BanEx(kohde, string);
    }
    return 1;
}
but there are two errors

Код:
E:\SAMP Server\PitBull Freeroam\gamemodes\pitbull.pwn(889) : error 017: undefined symbol "i"
E:\SAMP Server\PitBull Freeroam\gamemodes\pitbull.pwn(910) : error 017: undefined symbol "string"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#2

Код:
CMD:ban(playerid, params[])
{
    if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid))
    {
        new tmp[256], tmp2[256], Index, i, string[256];
        tmp = strtok(params,Index), tmp2 = strtok(params,Index);

        if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "Napisi: /ban [ID] [razlog]");

        new kohde;
        kohde = strval(tmp);

        if(!strlen(tmp2)) return SendClientMessage(playerid, COLOR_RED, "Napisi: /ban [ID] [razlog]");


        if(!IsPlayerConnected(kohde)) return SendClientMessage(playerid, COLOR_RED, "Netocan ID");

        if(IsPlayerConnected(i))
        {
            if (IgracInfo[playerid][Jezik] == 1) format(string, sizeof(string), "BAN: %s e baniran. (pricina: %s)", PlayerName(kohde), params[2]);
            else if (IgracInfo[playerid][Jezik] == 2) format(string, sizeof(string), "BAN: %s Je banan sa servera. (razlog: %s)", PlayerName(kohde), params[2]);
            else if (IgracInfo[playerid][Jezik] == 3) format(string, sizeof(string), "BAN: %s is banned. (%s)", PlayerName(kohde), params[2]);
            SendClientMessageToAll(COLOR_RED, string);
        }
        return BanEx(kohde, string);
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by BaRRyS3R
Посмотреть сообщение
Код:
CMD:ban(playerid, params[])
{
    if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid))
    {
        new tmp[256], tmp2[256], Index, i, string[256];
        tmp = strtok(params,Index), tmp2 = strtok(params,Index);

        if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "Napisi: /ban [ID] [razlog]");

        new kohde;
        kohde = strval(tmp);

        if(!strlen(tmp2)) return SendClientMessage(playerid, COLOR_RED, "Napisi: /ban [ID] [razlog]");


        if(!IsPlayerConnected(kohde)) return SendClientMessage(playerid, COLOR_RED, "Netocan ID");

        if(IsPlayerConnected(i))
        {
            if (IgracInfo[playerid][Jezik] == 1) format(string, sizeof(string), "BAN: %s e baniran. (pricina: %s)", PlayerName(kohde), params[2]);
            else if (IgracInfo[playerid][Jezik] == 2) format(string, sizeof(string), "BAN: %s Je banan sa servera. (razlog: %s)", PlayerName(kohde), params[2]);
            else if (IgracInfo[playerid][Jezik] == 3) format(string, sizeof(string), "BAN: %s is banned. (%s)", PlayerName(kohde), params[2]);
            SendClientMessageToAll(COLOR_RED, string);
        }
        return BanEx(kohde, string);
    }
    return 1;
}
i'm dont use sendclientmessagetoall
Spam will mean for how many players are included messages will write

i user sendclientmessage
Reply
#4

Quote:
Originally Posted by mariokumanovac
Посмотреть сообщение
This is my command for /ban

pawn Код:
CMD:ban(playerid, params[])
{
    if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid))
    {
        new tmp[256], tmp2[256], Index;
        tmp = strtok(params,Index), tmp2 = strtok(params,Index);

        if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "Napisi: /ban [ID] [razlog]");

        new kohde;
        kohde = strval(tmp);

        if(!strlen(tmp2)) return SendClientMessage(playerid, COLOR_RED, "Napisi: /ban [ID] [razlog]");


        if(!IsPlayerConnected(kohde)) return SendClientMessage(playerid, COLOR_RED, "Netocan ID");

        new string[128];
        format(string, sizeof(string), "BAN: %s Je banan sa servera. (razlog: %s)", PlayerName(kohde), params[2]);
        SendClientMessageToAll(COLOR_RED, string);

        return BanEx(kohde, string);
    }
    return 1;
}
How is it possible to make each player involved to check the language

I tried this way

pawn Код:
CMD:ban(playerid, params[])
{
    if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid))
    {
        new tmp[256], tmp2[256], Index;
        tmp = strtok(params,Index), tmp2 = strtok(params,Index);

        if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "Napisi: /ban [ID] [razlog]");

        new kohde;
        kohde = strval(tmp);

        if(!strlen(tmp2)) return SendClientMessage(playerid, COLOR_RED, "Napisi: /ban [ID] [razlog]");


        if(!IsPlayerConnected(kohde)) return SendClientMessage(playerid, COLOR_RED, "Netocan ID");

        if(IsPlayerConnected(i))
        {
            if (IgracInfo[playerid][Jezik] == 1)
            {
            new string[128];
            format(string, sizeof(string), "BAN: %s e baniran. (pricina: %s)", PlayerName(kohde), params[2]);
            SendClientMessageToAll(COLOR_RED, string);
            }
            if (IgracInfo[playerid][Jezik] == 2)
            {
            new string[128];
            format(string, sizeof(string), "BAN: %s Je banan sa servera. (razlog: %s)", PlayerName(kohde), params[2]);
            SendClientMessageToAll(COLOR_RED, string);
            }
            if (IgracInfo[playerid][Jezik] == 3)
            {
            new string[128];
            format(string, sizeof(string), "BAN: %s is banned. (%s)", PlayerName(kohde), params[2]);
            SendClientMessageToAll(COLOR_RED, string);
            }
        }
        return BanEx(kohde, string);
    }
    return 1;
}
but there are two errors

Код:
E:\SAMP Server\PitBull Freeroam\gamemodes\pitbull.pwn(889) : error 017: undefined symbol "i"
E:\SAMP Server\PitBull Freeroam\gamemodes\pitbull.pwn(910) : error 017: undefined symbol "string"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
pawn Код:
#Include <sscanf>
And

pawn Код:
new string[256];
Reply
#5

Nice bump.

Last Post On 27/07/2010, 10:54 AM
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)