[Ayuda] Comando quemar
#1

pues aver si alguien sabe como hacer para que al poner el comando /quemar ID, quemes durante 5 segndos a un jugador para saber si lleva ******, y que solo lo pueda usar admin lvl 1 para adelante, aqui dejo como tengo lo de para que solo lo pueda usar admin en los otros comandos

Код:
if(PlayerInfo[playerid][pAdmin] >= 1)
Reply
#2

pawn Код:
if(strcmp(cmd, "/explode", true) == 0)
    {
        GetPlayerName(playerid, sendername, sizeof(sendername));
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 4)
        {
            SendClientMessage(playerid, COLOR_GREY, "/explode [Playerid]");
            return 1;
        }
        giveplayerid = strval(tmp);
        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if(IsPlayerConnected(giveplayerid))
        {
            if(PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(IsPlayerConnected(giveplayerid))
                {
                    format(string, sizeof(string), "AdmCMD: %s was exploded by %s",giveplayer, sendername);
                    ABroadCast(COLOR_LIGHTRED,string,1);
                    //SendClientMessageToAll(COLOR_DBLUE, string);
                    SetPlayerHealth(giveplayerid, 10);
                    new Float:boomx, Float:boomy, Float:boomz;
                    GetPlayerPos(giveplayerid,boomx, boomy, boomz);
                    CreateExplosion(boomx, boomy , boomz, 7, 10);
                    new PlayerName[30];
                    GetPlayerName(playerid, PlayerName, 30);
                    printf("[Command] %s has used /explode to explode %s", PlayerName, giveplayer);
                }
                else
                {
                    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
                    SendClientMessage(playerid, COLOR_RED, string);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
        }
        return 1;
    }
Aver este si te ayudara..
Reply
#3

Quote:
Originally Posted by MrLevan
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/explode", true) == 0)
    {
        GetPlayerName(playerid, sendername, sizeof(sendername));
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 4)
        {
            SendClientMessage(playerid, COLOR_GREY, "/explode [Playerid]");
            return 1;
        }
        giveplayerid = strval(tmp);
        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if(IsPlayerConnected(giveplayerid))
        {
            if(PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(IsPlayerConnected(giveplayerid))
                {
                    format(string, sizeof(string), "AdmCMD: %s was exploded by %s",giveplayer, sendername);
                    ABroadCast(COLOR_LIGHTRED,string,1);
                    //SendClientMessageToAll(COLOR_DBLUE, string);
                    SetPlayerHealth(giveplayerid, 10);
                    new Float:boomx, Float:boomy, Float:boomz;
                    GetPlayerPos(giveplayerid,boomx, boomy, boomz);
                    CreateExplosion(boomx, boomy , boomz, 7, 10);
                    new PlayerName[30];
                    GetPlayerName(playerid, PlayerName, 30);
                    printf("[Command] %s has used /explode to explode %s", PlayerName, giveplayer);
                }
                else
                {
                    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
                    SendClientMessage(playerid, COLOR_RED, string);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
        }
        return 1;
    }
Aver este si te ayudara..
Bien Hecho pero me parece que tipeastede mas igual sirve
Reply
#4

me saltan estos errores, en la tercera linea
Код:
C:\Documents and Settings\Usuario\Mis documentos\samp\pawno\include\AdminSystem.inc(184) : error 017: undefined symbol "sendername"
C:\Documents and Settings\Usuario\Mis documentos\samp\pawno\include\AdminSystem.inc(184) : error 017: undefined symbol "sendername"
C:\Documents and Settings\Usuario\Mis documentos\samp\pawno\include\AdminSystem.inc(184) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Usuario\Mis documentos\samp\pawno\include\AdminSystem.inc(184) : fatal error 107: too many error messages on one line
Reply
#5

aver no estoy seguro pero prueba esto
pawn Код:
new sendername;
Reply
#6

al poner ese new me saltan 10 errores >.<
Reply
#7

aver enseсame ..
Reply
#8

estos son los errores
Quote:

C:\Documents and Settings\Usuario\Mis documentos\samp\pawno\include\AdminSystem.inc(186) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Usuario\Mis documentos\samp\pawno\include\AdminSystem.inc(186) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Usuario\Mis documentos\samp\pawno\include\AdminSystem.inc(187) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Usuario\Mis documentos\samp\pawno\include\AdminSystem.inc(187) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Usuario\Mis documentos\samp\pawno\include\AdminSystem.inc(190) : error 017: undefined symbol "COLOR_GREY"
C:\Documents and Settings\Usuario\Mis documentos\samp\pawno\include\AdminSystem.inc(193) : error 017: undefined symbol "giveplayerid"
C:\Documents and Settings\Usuario\Mis documentos\samp\pawno\include\AdminSystem.inc(194) : error 017: undefined symbol "giveplayerid"
C:\Documents and Settings\Usuario\Mis documentos\samp\pawno\include\AdminSystem.inc(194) : error 017: undefined symbol "giveplayer"
C:\Documents and Settings\Usuario\Mis documentos\samp\pawno\include\AdminSystem.inc(194) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Usuario\Mis documentos\samp\pawno\include\AdminSystem.inc(194) : fatal error 107: too many error messages on one line

Quote:

//---------------------------------------------------------------------------------------------------------------
if(strcmp(cmd, "/explode", true) == 0)//<--------------------------------------------- linea 186
{
GetPlayerName(playerid, sendername, sizeof(sendername));
tmp = strtok(cmdtext, idx);
if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 4)
{
SendClientMessage(playerid, COLOR_GREY, "/explode [Playerid]");
return 1;
}//<-------------------------------------------------------------------------------------linea 194
giveplayerid = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

Reply
#9

Que gamemod usas ?
Reply
#10

pawn Код:
new sendername[MAX_PLAYER_NAME];
ahi no deberia tirar error
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)