Why does it kick myself?
#4

PHP код:
#include <a_samp>
#include <zcmd> // need this
#include <sscanf> // need this
CMD:kick(playerid,params[])
{
    new 
targetid,name[MAX_PLAYER_NAME],name2[MAX_PLAYER_NAME],msg[128],msg2[128],msg3[128];
    {
        if(
sscanf(params,"u",targetid)) return SendCLientMessage(playerid,-1,"syntax: /kick [ID/name]");
        if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You are not admin");
        if(
IsPlayerAdmin(ID)) return SendClientMessage(playerid,-1,"You cannot kick other administrators");
        else if(
targetid == playerid) return SendClientMessage(playerid,-1,"You cannot kick yourself");
        else
        {
            
GetPlayerName(ID,name,sizeof(name)); // We take targetid's name
            
format(msg,sizeof(poruka),"You kicked %s from the server",name); // formating messages which will be sent to you
            
SendClientMessage(playerid,-1,poruka); // sent
            
GetPlayerName(playerid,name2,sizeof(name2)); //we take your name
            
format(msg2,sizeof(poruka2),"%s just kicked you from the server",name); // we send message to target
            
SendClientMessage(ID,-1,poruka2); // sent
            
format(msg3,sizeof(msg3),"%s kicked %s from the server",name2,name); // formating message to send for all
            
SendClientMessageToAll(-1,msg3); // sent
            
{
                
Kick(ID);
            }
        }
        return 
1;
    }

Here is an example. If you give me your enum i can make it more complicate.
Reply


Messages In This Thread
Why does it kick myself? - by saffierr - 31.03.2015, 10:04
Re: Why does it kick myself? - by CalvinC - 31.03.2015, 10:12
Re: Why does it kick myself? - by ATGOggy - 31.03.2015, 10:33
Re: Why does it kick myself? - by NoDi522 - 31.03.2015, 11:23
Re: Why does it kick myself? - by saffierr - 31.03.2015, 16:32

Forum Jump:


Users browsing this thread: 2 Guest(s)