scripting help!
#1

hi im testing a /freeze command but it dosent work it gives me error [ERROR]:YOU are not rcon admin (im already logged in rcon)

code:
Код:
CMD:freeze0(playerid,params[])
{
if(IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]:you are not rcon admin");
new targetid, str[75], reason[84] , pname[MAX_PLAYER_NAME];
if(sscanf(params,"ui",targetid)) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]:Usage(playerid/reason)");
if(playerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]:Player is not connected.");
TogglePlayerControllable(targetid,0);
format(str, sizeof(str), "admin %s has freezed you",pname);
SendClientMessage(playerid,-1,"Player Has Been Freezed");
SendClientMessage(targetid, COLOR_ADMIN,str);
return 1;
}
Reply
#2

PHP код:
if(IsPlayerAdmin(playerid))return SendClientMessage(playeridCOLOR_ERROR,"[ERROR]:you are not rcon admin"); 
Change To
PHP код:
if(!IsPlayerAdmin(playerid))return SendClientMessage(playeridCOLOR_ERROR,"[ERROR]:you are not rcon admin"); 
Reply
#3

Your code currently works for normal players but not for RCON administrators. Send the error message if "IsPlayerAdmin" returned false (Add "!" before IsPlayerAdmin).
Reply
#4

ops i forgot (!) thanks for reminding

rep to both!
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)