09.12.2009, 09:55
Hey, took /pm cmd from the Base Filterscript (credits to samp 0.3a whoever made it) Because i wanted to have it in my admin filterscript. But when i try to compile i get this error. Heres the code btw. And i took the numbers from the error rows.
And heres the error
Please help me with anything you can, thanks
Код:
// PM COMMAND (4605) new pName[MAX_PLAYER_NAME]; (4606) new Message[256]; (4607) new iName[MAX_PLAYER_NAME]; (4608) new gMessage[256]; (4609) (4610) if(strcmp("/pm", cmd, true) == 0) (4611) { (4612) new tmp[256]; (4613) new idx; tmp = strtok(cmdtext,idx); if(!strlen(tmp) || strlen(tmp) > 5) { SendClientMessage(playerid,red,"Usage: /pm (id) (message)"); return 1; } new id = strval(tmp); gMessage = strrest(cmdtext,idx); if(!strlen(gMessage)) { SendClientMessage(playerid,red,"Usage: /pm (id) (message)"); return 1; } if(!IsPlayerConnected(id)) { SendClientMessage(playerid,red,"Bad player ID"); return 1; } if(playerid != id) { GetPlayerName(id,iName,sizeof(iName)); GetPlayerName(playerid,pName,sizeof(pName)); format(Message,sizeof(Message),"%s(%d): %s",pName,playerid,gMessage); SendClientMessage(id,yellow,Message); PlayerPlaySound(id,1085,0.0,0.0,0.0); printf("[Pm] %s: '%s' to %s",pName,Message,iName); } else { SendClientMessage(playerid,red,"Cant PM Yourself"); } return 1; } // Ends here
Код:
C:\Documents and Settings\Administrator\Desktop\Server\filterscripts\admin.pwn(4605) : warning 219: local variable "pName" shadows a variable at a preceding level C:\Documents and Settings\Administrator\Desktop\Server\filterscripts\admin.pwn(4612) : warning 219: local variable "tmp" shadows a variable at a preceding level C:\Documents and Settings\Administrator\Desktop\Server\filterscripts\admin.pwn(4613) : warning 219: local variable "idx" shadows a variable at a preceding level Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Warnings.