Help With Admin System - Guest3598475934857938411 - 11.07.2010
Hello recently I made my own admin system. I followed a tut from this link:
https://sampforum.blast.hk/showthread.php?tid=154852 . Mind someone give me a sample admin command I tried making one that i used for rcon but it didnt work. Plz Help!!!
Re: Help With Admin System -
Lorenc_ - 11.07.2010
Sure,
/ban using dcmd and sscanff
pawn Код:
dcmd_ban(playerid,params[])
{
new Reason[256], pID;
if(PlayerInfo[playerid][pAdminLevel] < 3)
{
return SendClientMessage(playerid,COLOR_RED,"You need to be at least over Admin level 3 to use this command.");
}
if(sscanf(params,"us",pID,Reason))
{
return SendClientMessage(playerid,COLOR_RED,"USAGE: /ban [playerid] [reason]");
}
if(!IsPlayerConnected(pID))
{
return SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID!");
}
if(PlayerInfo[playerid][pAdminLevel] < PlayerInfo[pID][pAdminLevel])
{
return SendClientMessage(playerid,COLOR_RED,"You can't use this command on a high ranked admin");
}
if(pID == playerid)
{
SendClientMessage(playerid,COLOR_RED,"You cannot ban yourself.");
return 1;
}
new name[MAX_PLAYER_NAME], string[256];
GetPlayerName(pID,name,sizeof(name));
new Aname[MAX_PLAYER_NAME];
GetPlayerName(playerid,Aname,sizeof(Aname));
format(string,sizeof(string)," %s has banned %s with the reason: %s",Aname,name,Reason[0] ? Reason : "<No Reason>");
SendClientMessageToAll(COLOR_GREEN,string);
Ban(pID);
return 1;
}
just made it my self :/
Re: Help With Admin System - Guest3598475934857938411 - 11.07.2010
Hey dude it didn't work I got these errors and warrnings.
C:\Users\Owner\Desktop\EPro Stunt, DM\gamemodes\epro.pwn(763) : error 017: undefined symbol "PlayerInfo"
C:\Users\Owner\Desktop\EPro Stunt, DM\gamemodes\epro.pwn(763) : warning 215: expression has no effect
C:\Users\Owner\Desktop\EPro Stunt, DM\gamemodes\epro.pwn(763) : error 001: expected token: ";", but found "]"
C:\Users\Owner\Desktop\EPro Stunt, DM\gamemodes\epro.pwn(763) : error 029: invalid expression, assumed zero
C:\Users\Owner\Desktop\EPro Stunt, DM\gamemodes\epro.pwn(763) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Here's the code with my lines
http://pastebin.com/BSvAbr1z
Re: Help With Admin System -
Cameltoe - 11.07.2010
You are missing a bracket somewhere ( } )
Re: Help With Admin System -
DeathOnaStick - 11.07.2010
Quote:
Originally Posted by expertprogrammer
Hey dude it didn't work I got these errors and warrnings.
C:\Users\Owner\Desktop\EPro Stunt, DM\gamemodes\epro.pwn(763) : error 017: undefined symbol "PlayerInfo"
C:\Users\Owner\Desktop\EPro Stunt, DM\gamemodes\epro.pwn(763) : warning 215: expression has no effect
C:\Users\Owner\Desktop\EPro Stunt, DM\gamemodes\epro.pwn(763) : error 001: expected token: ";", but found "]"
C:\Users\Owner\Desktop\EPro Stunt, DM\gamemodes\epro.pwn(763) : error 029: invalid expression, assumed zero
C:\Users\Owner\Desktop\EPro Stunt, DM\gamemodes\epro.pwn(763) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Here's the code with my lines
http://pastebin.com/BSvAbr1z
|
Did you make an admin system yet? Is it finished? You need some way to check if the player is an admin, how does it work in ur script?
Quote:
Originally Posted by Cameltoe
You are missing a bracket somewhere ( } )
|
Incorrect, he isn't.
Re: Help With Admin System -
RatHack - 11.07.2010
download a good admin system and there u will have soo much cmds
Re: Help With Admin System -
DeathOnaStick - 11.07.2010
Quote:
Originally Posted by RatHack
download a good admin system and there u will have soo much cmds
|
Downloaded scripts arent always the best sollution. I made my own by myself and it works better on my server than any downloaded Admin script could and i can modify it by myself without getting any problems, because i know how it was done.
Re: Help With Admin System -
Cameltoe - 11.07.2010
Quote:
Originally Posted by DeathOnaStick
Downloaded scripts arent always the best sollution. I made my own by myself and it works better on my server than any downloaded Admin script could and i can modify it by myself without getting any problems, because i know how it was done.
|
You are right he's not missing a bracket..
Creating an own admin script will also give you skills as you practice.
Re: Help With Admin System -
oliverrud - 11.07.2010
The best is to make it yourself as it increases your skills a lot more then if you just copy & paste some others and edit it.
Re: Help With Admin System - Guest3598475934857938411 - 11.07.2010
Um did u read the post "Hello recently I made my own admin system. I followed a tut from this link:
https://sampforum.blast.hk/showthread.php?tid=154852 . Mind someone give me a sample admin command I tried making one that i used for rcon but it didnt work. Plz Help!!! " u could check the link to know how it works it uses dini so yea.