Command error
#1

Код:
CMD:ban(playerid, params[])
{
    new id, reason[50], string[128], banned[MAX_PLAYER_NAME];
    if(PlayerInfo[playerid][pAdminLevel] < 2 || !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,red,"You Are not Rcon admin Or admin lvl 3+");
    if(sscanf(params, "uz", id, reason)) return SendClientMessage(playerid, -1, "USAGE: /ban [playerid] [reason(optional)]");
    GetPlayerName(id, banned, sizeof(banned));
    format(string, sizeof(string), "AdmCmd: %s has been banned by %s. reason: %s", banned, GetName(playerid), reason);
    SendClientMessageToAll(red, string);
    BanEx(id, reason);
    return 1;
}
help
errors
Код:
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(442) : error 017: undefined symbol "PlayerInfo"
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(442) : warning 215: expression has no effect
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(442) : error 001: expected token: ";", but found "]"
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(442) : error 029: invalid expression, assumed zero
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(442) : fatal error 107: too many error messages on one line
Reply
#2

Well, either don't you have a Player variable to store the information, or you entered the wrong variable name, do you have some /stats or something to look up the variable?
Reply
#3

no only pay kick giveall and this error ban command
Reply
#4

Quote:
Originally Posted by Dejan12345
Посмотреть сообщение
no only pay kick giveall and this error ban command
show the decalaration
Reply
#5

Show me /giveall if it's for admins only, that way, I assume you're checking there.
Reply
#6

here all function
Код:
 
CMD:ban(playerid, params[])
{
    new id, reason[50], string[128], banned[MAX_PLAYER_NAME];
    if(PlayerInfo[playerid][pAdminLevel] < 2 || !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,red,"You Are not Rcon admin Or admin lvl 3+");
    if(sscanf(params, "uz", id, reason)) return SendClientMessage(playerid, -1, "USAGE: /ban [playerid] [reason(optional)]");
    GetPlayerName(id, banned, sizeof(banned));
    format(string, sizeof(string), "AdmCmd: %s has been banned by %s. reason: %s", banned, GetName(playerid), reason);
    SendClientMessageToAll(red, string);
    BanEx(id, reason);
    return 1;
}
Reply
#7

You just reposted the /ban command, show us the /giveall.
Reply
#8

Код:
CMD:giveall(playerid, params[])
{
	new value;
	if(!IsPlayerAdmin(playerid)) return 1;
	if(sscanf(params, "d", value) != 0) SendClientMessage(playerid, 0xFF0000AA, "Koristi: /giveall [Koliko Para]");
	for(new i=0; i<MAX_PLAYERS; i++)
	{
	    if(IsPlayerConnected(i))
	    {
	        GivePlayerMoney(i, value);
	    }
	}
	return 1;
}
here
Reply
#9

Since you're using rcon;
PHP код:
CMD:ban(playeridparams[])
{
    new 
idreason[50], string[128], banned[MAX_PLAYER_NAME];
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid,red,"You Are not Rcon admin Or admin lvl 3+");
    if(
sscanf(params"uz"idreason)) return SendClientMessage(playerid, -1"USAGE: /ban [playerid] [reason(optional)]");
    
GetPlayerName(idbannedsizeof(banned));
    
format(stringsizeof(string), "AdmCmd: %s has been banned by %s. reason: %s"bannedGetName(playerid), reason);
    
SendClientMessageToAll(redstring);
    
BanEx(idreason);
    return 
1;

Reply
#10

lol
Код:
if(!IsPlayerAdmin(playerid)) return 1;
Change it to

Код:
if(!IsPlayerAdmin(playerid)) return 0;
In the giveall command
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)