Admins Cmds
#1

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

WithOut any inc Its Possible
Reply
#2

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!");

Reply
#3

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
Reply
#4

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;

Reply
#5

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
Reply
#6

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
Reply
#7

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;

Reply
#8

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
Reply
#9

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`.
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)