How to create command clan?
#1

Hello guys, I am new to forums so I do not know if this is the right section.
I'm Italian so my English is scarce asd.
Ok, I have a server, and I wanted to create the command / kickclan [CLANTAG] / banclan [TAGCLAN] / crashclan [TAGCLAN] with DCMD, however, after several attempts I who could help me out?

Thanks in advance
Reply
#2

pawn Код:
dcmd_kickclan(playerid,params[])
{
    new name[24];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        GetPlayerName(i,name,24);
        if(strfind(name,params,true) != -1)
        {
            kick(i);
        }
    }
    return 1;
}
That's the basic, modify it however you want.
Reply
#3

Thanks, now I try and tell you if it works ^ ^.
Reply
#4

Ok, I tested and it works, but I wanted to ask because usually I do not ever be the case today gives me warning symbol is never used playerid? Corrects this problem with pragma unusued playerid but usually not by me ever since?
Reply
#5

you should use playerid..


Код:
dcmd_kickclan(playerid,params[])
{
    if(!IsPlayerAdmin(playerid)) return 0;
    new name[24];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        GetPlayerName(i,name,24);
        if(strfind(name,params,true) != -1)
        {
            kick(i);
        }
    }
    return 1;
}
if you dont do so , every player will be able to use the cmd (not only admins)
Reply
#6

Quote:
Originally Posted by NaTkAkN
Посмотреть сообщение
Ok, I tested and it works, but I wanted to ask because usually I do not ever be the case today gives me warning symbol is never used playerid? Corrects this problem with pragma unusued playerid but usually not by me ever since?
I told you that I gave you the most basic command possible and you can modify it yourself.
By modify I meant adding messages and admin permissions ETC.
Reply
#7

ok thanks .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)