Help dcmd command >KICK<
#1

i try to make command with params something like this

pawn Код:
dcmd_kick(playerid,params[])
{
    if (strlen(params))
    {
        id = strval(params);
        if (IsPlayerConnected(id))
        {
            SendClientMessage(id, 0x00FF00AA, "Dobio si kick od administratora"); // BOJA
            Kick(id);
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "[ERROR]: Igrac nije online.");
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_ORANGE, "/kick [playerid]");
    }
   
}
and i get 4 errors

C:\Users\NASTIE\Desktop\samp03asvr_R8_win32\gamemo des\NeonRoleplay.pwn(661) : error 017: undefined symbol "id"
C:\Users\NASTIE\Desktop\samp03asvr_R8_win32\gamemo des\NeonRoleplay.pwn(662) : error 017: undefined symbol "id"
C:\Users\NASTIE\Desktop\samp03asvr_R8_win32\gamemo des\NeonRoleplay.pwn(664) : error 017: undefined symbol "id"
C:\Users\NASTIE\Desktop\samp03asvr_R8_win32\gamemo des\NeonRoleplay.pwn(665) : error 017: undefined symbol "id"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.


Can you help me?
Reply
#2

pawn Код:
dcmd_kick(playerid,params[])
{
    new id;
    if (strlen(params))
    {
        id = strval(params);
        if (IsPlayerConnected(id))
        {
            SendClientMessage(id, 0x00FF00AA, "Dobio si kick od administratora"); // BOJA
            Kick(id);
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "[ERROR]: Igrac nije online.");
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_ORANGE, "/kick [playerid]");
    }
   
}
Reply
#3

You have forgot to define "id".
pawn Код:
dcmd_kick(playerid,params[])
{
    new id;
    if (strlen(params))
    {
        id = strval(params);
        if (IsPlayerConnected(id))
        {
            SendClientMessage(id, 0x00FF00AA, "Dobio si kick od administratora"); // BOJA
            Kick(id);
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "[ERROR]: Igrac nije online.");
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_ORANGE, "/kick [playerid]");
    }
   
}
Reply
#4

Damn forums..
Reply
#5

tnx guys
Reply
#6

How to make command like this /makeadmin ID LVL

i define admin lvls on this way

pawn Код:
dcmd_makeadmin(playerid, params[])
{
    #pragma unused params
    if(PlayerInfo[playerid][AdminLvl] >= 1337 || IsPlayerAdmin(playerid))
    {
    }
    else
    {
      SendClientMessage(playerid, COLOR_RED, "[ERROR]: Moras biti admin kako bi mogao koristiti ovu komandu.");
    }
    return 1;

}
Reply
#7

pawn Код:
dcmd_setadmin(playerid,params[])
{
new string[286];
new giveplayerid;
giveplayerid = strval(params);
new amount;
if(AdminLvl[playerid] <=3)
{
SendClientMessage(playerid,COLOR_RED,"You are not allowed to do this");
return 1;
}
if(sscanf(params,"ud",giveplayerid,amount))
{
SendClientMessage(playerid,COLOR_RED,"USAGE:/setadmin [playerid] [amount]");
return 1;
}
if(!IsPlayerConnected(giveplayerid))
{
SendClientMessage(playerid,COLOR_RED,"This player is not connected");
return 1;
}
AdminLvl[giveplayerid] = amount;
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),"Your admin level is setted to %d by %s",amount,playername);
SendClientMessage(giveplayerid,COLOR_RED,string);

GetPlayerName(giveplayerid,playername,sizeof(playername));
format(string,sizeof(string),"You have setted %s his admin level to %d",playername,amount);
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
Reply
#8

tnx again
Reply
#9

Srry for bump again i get this errors

C:\Users\NASTIE\Desktop\samp03asvr_R8_win32\gamemo des\NeonRoleplay.pwn(705) : error 017: undefined symbol "playername"
C:\Users\NASTIE\Desktop\samp03asvr_R8_win32\gamemo des\NeonRoleplay.pwn(705) : error 017: undefined symbol "playername"
C:\Users\NASTIE\Desktop\samp03asvr_R8_win32\gamemo des\NeonRoleplay.pwn(705) : error 029: invalid expression, assumed zero
C:\Users\NASTIE\Desktop\samp03asvr_R8_win32\gamemo des\NeonRoleplay.pwn(705) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#10

new playername[MAX_PLAYER_NAME];
Reply


Forum Jump:


Users browsing this thread: