SA-MP Forums Archive
Admins Cmds - 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)
+--- Thread: Admins Cmds (/showthread.php?tid=633467)



Admins Cmds - dopeboy1040 - 01.05.2017

Guzs I want Some Admins Command Like Kick Ban Make Admin Freeze Unfreeze

WithOut any inc Its Possible


Re: Admins Cmds - moura98 - 01.05.2017

so easy my friend
PHP код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
enum info {
    
adminlevel
};
new 
pinfo[MAX_PLAYERS][info];
CMD:kick(playeridparams[])
{
    new 
id;
    if (
sscanf(params"u"id)) return SendClientMessage(playerid,-1"usage: /kick <id>");
    if( 
pinfo[playerid][adminlevel] += )
    {
        
Kick(id);
    }
    else return 
SendClientMessage (playerid, -1"you dont have permission!");




Re: Admins Cmds - dopeboy1040 - 06.05.2017

Thanks Brother Thank u soo much
BUT ITS GIVE ME WARNING

C:\Users\Ali Computer\Desktop\0.3.7\filterscripts\Adminsmy.pwn( 59) : warning 209: function "cmd_kick" should return a value
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.
And How to add This Filterscript On my gamemode


Re: Admins Cmds - jlalt - 06.05.2017

PHP код:
if( pinfo[playerid][adminlevel] += 
;_; are you good sir?
PHP код:
if( pinfo[playerid][adminlevel] >= 
about return , you simple needed a return 1; somewhere so ->

PHP код:
CMD:kick(playeridparams[]) 

    new 
id
    if (
sscanf(params"u"id)) return SendClientMessage(playerid,-1"usage: /kick <id>"); 
    if( 
pinfo[playerid][adminlevel] >= 
    { 
        
Kick(id); 
    } 
    else
    {
        
SendClientMessage (playerid, -1"you dont have permission!"); 
    }
    return 
1;




Re: Admins Cmds - Loinal - 06.05.2017

Quote:
Originally Posted by dopeboy1040
Посмотреть сообщение
Guzs I want Some Admins Command Like Kick Ban Make Admin Freeze Unfreeze

WithOut any inc Its Possible
PHP код:
CMD:freeze(playerid,params)
{
     new 
id;
     if(
sscanf(params,"u",id))
     {
        
SendClientMessage(playerid,0xFF0000FF,"USAGE: /freeze [playerid");
        return 
1;
     }
     if(
IsPlayerConnected(id) && id != playerid)
     {
        
TogglePlayerControllable(id0);
     }
     return 
1;
}
CMD:unfreeze(playerid,params)
{
     new 
id;
     if(
sscanf(params,"u",id))
     {
        
SendClientMessage(playerid,0xFF0000FF,"USAGE: /unfreeze [playerid");
        return 
1;
     }
     if(
IsPlayerConnected(id) && id != playerid)
     {
        
TogglePlayerControllable(id1);
     }
     return 
1;

It is possible


Re: Admins Cmds - dopeboy1040 - 07.05.2017

Quote:
Originally Posted by jlalt
Посмотреть сообщение
PHP код:
if( pinfo[playerid][adminlevel] += 
;_; are you good sir?
PHP код:
if( pinfo[playerid][adminlevel] >= 
about return , you simple needed a return 1; somewhere so ->

PHP код:
CMD:kick(playeridparams[]) 

    new 
id
    if (
sscanf(params"u"id)) return SendClientMessage(playerid,-1"usage: /kick <id>"); 
    if( 
pinfo[playerid][adminlevel] >= 
    { 
        
Kick(id); 
    } 
    else
    {
        
SendClientMessage (playerid, -1"you dont have permission!"); 
    }
    return 
1;

Yes I was Under stand Thats Its bring a Return value Thanks You So much

But its was Compile And I Add this Filterscript On My Sever.configuration Its Looaded When i Write command /Kick But Not work What can i Do


Re: Admins Cmds - ShihabSoft - 07.05.2017

Quote:

C:\Users\Ali Computer\Desktop\0.3.7\filterscripts\Adminsmy.pwn( 59) : warning 209: function "cmd_kick" should return a value
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Just add a return 1; to the end of the function, just like shown below.

PHP код:
CMD:kick(playeridparams[]) 

    new 
id
    if (
sscanf(params"u"id)) return SendClientMessage(playerid,-1"usage: /kick <id>"); 
    if( 
pinfo[playerid][adminlevel] += 
    { 
        
Kick(id); 
    } 
    else return 
SendClientMessage (playerid, -1"you dont have permission!"); 
return 
1;




Re: Admins Cmds - dopeboy1040 - 07.05.2017

Quote:
Originally Posted by ShihabSoft
Посмотреть сообщение
Just add a return 1; to the end of the function, just like shown below.

PHP код:
CMD:kick(playeridparams[]) 

    new 
id
    if (
sscanf(params"u"id)) return SendClientMessage(playerid,-1"usage: /kick <id>"); 
    if( 
pinfo[playerid][adminlevel] += 
    { 
        
Kick(id); 
    } 
    else return 
SendClientMessage (playerid, -1"you dont have permission!"); 
return 
1;

No I UnderStand Its Compile and No warning Just Tell me How to add My filter Script On My gamemode Grandlac1


Re: Admins Cmds - coool - 07.05.2017

Quote:
Originally Posted by dopeboy1040
Посмотреть сообщение
No I UnderStand Its Compile and No warning Just Tell me How to add My filter Script On My gamemode Grandlac1
Go to `server.cfg`, put your filterscript name in `filterscripts`.


Re: Admins Cmds - moura98 - 07.05.2017

Quote:
Originally Posted by jlalt
Посмотреть сообщение
PHP код:
if( pinfo[playerid][adminlevel] += 
;_; are you good sir?
PHP код:
if( pinfo[playerid][adminlevel] >= 
about return , you simple needed a return 1; somewhere so ->

PHP код:
CMD:kick(playeridparams[]) 

    new 
id
    if (
sscanf(params"u"id)) return SendClientMessage(playerid,-1"usage: /kick <id>"); 
    if( 
pinfo[playerid][adminlevel] >= 
    { 
        
Kick(id); 
    } 
    else
    {
        
SendClientMessage (playerid, -1"you dont have permission!"); 
    }
    return 
1;

Yes you correct, this is just fault of attention