sscanf errors
#1

Hello, Can someone tell me what's wrong in this? (I didn't finish the command yet)

SCRIPT:
PHP код:
CMD:ban(playeridparams[]) //line 1
{  //line 2
    
new IDreason[30];  //line 3
    
if(pInfo[playerid][Admin] < 3) return NotAdminMSG(playerid);  //line 4
    
if(sscanf(params"us[30]"IDreason)) return SCM(playeridCOLOR_WHITE""WORD_USAGE"/ban [PLAYER_ID] [REASON]");  //line 5
    
if(!IsPlayerConnected(ID)) return SCM(playeridCOLOR_WHITE""WORD_ERROR"This player is not connected.");  //line 6
    
if(pInfo[playerid][Admin] < pInfo[ID][Admin]) return SCM(playeridCOLOR_WHITE""WORD_ERROR"You cannot apply this command on a higher admin.");  //line 7
    
return 1;  //line 8
}  //line 9 
ERRORS:
Код:
C:\Program Files\MyServer\pawno\include\required/admin_commands.inc(3) : warning 219: local variable "ID" shadows a variable at a preceding level
C:\Program Files\MyServer\pawno\include\required/admin_commands.inc(5) : warning 213: tag mismatch
C:\Program Files\MyServer\pawno\include\required/admin_commands.inc(6) : warning 213: tag mismatch
C:\Program Files\MyServer\pawno\include\required/admin_commands.inc(7) : warning 213: tag mismatch
C:\Program Files\MyServer\pawno\include\required/admin_commands.inc(3) : warning 203: symbol is never used: "ID"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Warnings.
Reply
#2

1. Try to make ID2 from ID
2. I belive this: ""WORD_USAGE"/ban is wrong. I use it like that SCM(playerid, -1, WORD_USAGE"/ban");
Reply
#3

Quote:
Originally Posted by Donboo
Посмотреть сообщение
1. Try to make ID2 from ID
2. I belive this: ""WORD_USAGE"/ban is wrong. I use it like that SCM(playerid, -1, WORD_USAGE"/ban");
Solved, The problem was in "ID", I changed it to pID and worked well.
Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)