SA-MP Forums Archive
Help Me Plz - 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 Me Plz (/showthread.php?tid=231984)



fixed - [FMJ]BlueFire - 26.02.2011

fixed


Re: Help Me Plz - ifly4life - 26.02.2011

doing this in a hurry so...
Код:
	if ( strcmp ( cmd , "/ban" , true ) == 0 && IsPlayerAdmin ( playerid ) )
	{
	    new tmp [ 256 ];

	    new message [ 256 ];

		tmp = strtok ( cmdtext , idx );

        if( ! strlen ( tmp ) )
		{
		    SendClientMessage ( playerid , GREY , "USAGE: /ban [playerid]" );
		    return 1;
	    }

	    new giveplayerid = strval(tmp);

	    tmp = strtok(cmdtext, idx);

        if(!strlen(tmp))
	    {
	        if (IsPlayerConnected(giveplayerid))
	        {
   	            format(string, sizeof(string), "Admin %s (player: %d) has banned %s (player: %d) from the server.",GetName(playerid), playerid, GetName(giveplayerid), giveplayerid);
	            SendClientMessageToAll(GREY, string);
                printf(string);
	            SendClientMessageToAll(GREY,"No reason given.");
                printf(string);
			    Ban(giveplayerid);
   	            return 1;
		    }
			else
			{
                format(string, sizeof(string), "[ERROR] ID %d is not an active player.", giveplayerid);
                SendClientMessage(playerid, GREY, string);
                return 1;
            }
        }

        if(giveplayerid < 10)
        {
		    strmid ( message , cmdtext , 6 , strlen ( cmdtext ) );
        }
		else
		{
            strmid ( message , cmdtext , 7 , strlen ( cmdtext ) );
        }

   	    if (IsPlayerConnected(giveplayerid))
	    {
            format(string, sizeof(string), "Admin %s (player: %d) has banned %s (player: %d) from the server.",GetName(playerid), playerid, GetName(giveplayerid), giveplayerid);
		    SendClientMessageToAll(GREY, string);
			printf(string);
		    format(string, sizeof(string), "reason: %s.",message);
		    SendClientMessageToAll(GREY, string);
            printf(string);
			Ban(giveplayerid);
			return 1;
	    }
		else
		{
            format(string, sizeof(string), "[ERROR] ID %d is not an active player.", giveplayerid);
            SendClientMessage(playerid, GREY, string);
            return 1;
        }
	}
and for 6.) try a streamer


Re: Help Me Plz - [FMJ]BlueFire - 26.02.2011

k first
thx for the /ban cmd
but my question was how to make somthing only for admins/vips
like the cmd:

if(IsPlayerAdmin(playerid))

but want to set this cmd to lvl
i mean like a ban will be for lvl 3 and kick will be for lvl 2
(for the vips 2)

and
do u have a good plugins for loading objects?


Re: Help Me Plz - maramizo - 26.02.2011

Do you have a liable VIP system?


Re: Help Me Plz - [FMJ]BlueFire - 27.02.2011

nope


Re: Help Me Plz - [FMJ]BlueFire - 27.02.2011

fixed