SA-MP Forums Archive
Help dcmd command >KICK< - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help dcmd command >KICK< (/showthread.php?tid=160612)



Help dcmd command >KICK< - DarkPower - 17.07.2010

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?


Re: Help dcmd command >KICK< - Dolph - 17.07.2010

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]");
    }
   
}



Re: Help dcmd command >KICK< - [XST]O_x - 17.07.2010

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]");
    }
   
}



Re: Help dcmd command >KICK< - Grim_ - 17.07.2010

Damn forums..


Re: Help dcmd command >KICK< - DarkPower - 17.07.2010

tnx guys


Re: Help dcmd command >KICK< - DarkPower - 17.07.2010

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;

}



Re: Help dcmd command >KICK< - bartje01 - 17.07.2010

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;
}



Re: Help dcmd command >KICK< - DarkPower - 17.07.2010

tnx again


Re: Help dcmd command >KICK< - DarkPower - 17.07.2010

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.


Re: Help dcmd command >KICK< - bartje01 - 17.07.2010

new playername[MAX_PLAYER_NAME];