// 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.
Originally Posted by Mikep.
You alredy have 'new pName' etc. somewhere else.
|
Originally Posted by TheOneThatOwnZ
All you have to do is // the new pName etc.
|
// PM COMMAND (4605) new pName[MAX_PLAYER_NAME]; (4606) new Message[256]; (4607) new iName[MAX_PLAYER_NAME]; (4608) new gMessage[256]; i may not understand much about scripting but mine is working and i have new pName[MAX_PLAYER_NAME+1]; and new tmp[256]; new idx; at the top of the pm command
Originally Posted by TheOneThatOwnZ
Quote:
|