Can you show us what you've done up to now? And can you show us how you load / save your variables too? That'd help us.
He wants a kick and ban command that reads off the variables of Admin='%d', if the sender is not admin, it should return "get a admin noob". I think that's what he wants. |
CMD:kick(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"Admins Only"); new tmp[128]; tmp = strtok(cmdtext, idx); Kick(strval(tmp)); return 1; }
CMD:kick(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, "Admins only.");
new targetid;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Syntax: /kick [playerid/name]");
Kick(targetid);
return 1;
}
CMD:kick(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, "Admins only.");
new targetid, reason[50];
if(sscanf(params, "us[50]", targetid, reason)) return SendClientMessage(playerid, -1, "Syntax: /kick [playerid/name] [reason]");
if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Error: Player not connected.");
new string[100], sendername[MAX_PLAYER_NAME], receivername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(targetid, receivername, sizeof(receivername));
format(string, sizeof(string), "%s has been kicked by %s, reason: %s", receivername, sendername, reason);
SendClientMessageToAll(COLOR_WHITE, string);
return 1;
}
C:\Users\Kompas\Desktop\fag\filterscripts\admin.pwn(8) : error 017: undefined symbol "PlayerInfo" C:\Users\Kompas\Desktop\fag\filterscripts\admin.pwn(8) : warning 215: expression has no effect C:\Users\Kompas\Desktop\fag\filterscripts\admin.pwn(8) : error 001: expected token: ";", but found "]" C:\Users\Kompas\Desktop\fag\filterscripts\admin.pwn(8) : error 029: invalid expression, assumed zero C:\Users\Kompas\Desktop\fag\filterscripts\admin.pwn(8) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
#include <a_samp> #include <zcmd> #include <sscanf2> #include <YSI\y_ini> CMD:kick(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, "Admins only."); new targetid; if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Syntax: /kick [playerid/name]"); Kick(targetid); return 1; }
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, "Admins only.");
Now,I get this:
Код:
C:\Users\Kompas\Desktop\fag\filterscripts\admin.pwn(8) : error 017: undefined symbol "PlayerInfo" C:\Users\Kompas\Desktop\fag\filterscripts\admin.pwn(8) : warning 215: expression has no effect C:\Users\Kompas\Desktop\fag\filterscripts\admin.pwn(8) : error 001: expected token: ";", but found "]" C:\Users\Kompas\Desktop\fag\filterscripts\admin.pwn(8) : error 029: invalid expression, assumed zero C:\Users\Kompas\Desktop\fag\filterscripts\admin.pwn(8) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. Код:
#include <a_samp> #include <zcmd> #include <sscanf2> #include <YSI\y_ini> CMD:kick(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, "Admins only."); new targetid; if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Syntax: /kick [playerid/name]"); Kick(targetid); return 1; } Код:
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, "Admins only."); |
enum pInfo
{
pPass,
pCash,
pKills,
pDeaths,
pAdminLevel
}
new PlayerInfo[MAX_PLAYERS][pInfo]; // so my enum uses PlayerInfo[playerid][pAdminLevel]
if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, -1, "Admins only.");