PM Command - 4 Warning - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: PM Command - 4 Warning (
/showthread.php?tid=274788)
[FIXED!]PM Command - 4 Warning -
lyrics - 07.08.2011
Problem Solved!
Thanks To Gold And IPLEOMAX
Re: PM Command - 4 Warning -
Wesley221 - 07.08.2011
Its usefull if you post the warnings aswell
Re: PM Command - 4 Warning -
lyrics - 07.08.2011
Heres The Warning:
Код HTML:
H:\GTA San Andreas\SAMP Server\gamemodes\XtremeKakashiV1.pwn(579) : warning 219: local variable "pName" shadows a variable at a preceding level
H:\GTA San Andreas\SAMP Server\gamemodes\XtremeKakashiV1.pwn(598) : warning 219: local variable "pName" shadows a variable at a preceding level
H:\GTA San Andreas\SAMP Server\gamemodes\XtremeKakashiV1.pwn(690) : warning 219: local variable "pName" shadows a variable at a preceding level
H:\GTA San Andreas\SAMP Server\gamemodes\XtremeKakashiV1.pwn(704) : warning 219: local variable "pName" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Warnings.
Re: PM Command - 4 Warning -
Shockey HD - 07.08.2011
It appears that pName is being repeated someone in the command
Re: PM Command - 4 Warning -
lyrics - 07.08.2011
Quote:
Originally Posted by Shockey HD
It appears that pName is being repeated someone in the command
|
Can you help me?
Post the code here if you know the problem
Re: PM Command - 4 Warning -
gold - 07.08.2011
Added this :
Re: PM Command - 4 Warning -
[HiC]TheKiller - 07.08.2011
You are defining pName when it is already defined somewhere out of a callback (A global variable). Go to lines 579, 598, 690 and 704 and delete where you create the variable pName.
Re: PM Command - 4 Warning -
lyrics - 07.08.2011
Quote:
Originally Posted by gold
|
Where should i put this?
And Put the Whole Code of PM + pName[MAX_PLAYERS];
Re: PM Command - 4 Warning - array13 - 07.08.2011
ZCMD
PHP код:
COMMAND:pm(playerid, params[])
{
new OtherPlayer, Message[128], Msg1[128], Msg2[128], YourName[24], OtherPlayerName[24];
if (APlayerData[playerid][LoggedIn] == true)
{
if (sscanf(params, "us[128]", OtherPlayer, Message)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/pm <OtherPlayer> <Message>\"");
else
{
if (IsPlayerConnected(OtherPlayer))
{
if (APlayerData[playerid][Muted] == false)
{
GetPlayerName(playerid, YourName, sizeof(YourName));
GetPlayerName(OtherPlayer, OtherPlayerName, sizeof(OtherPlayerName));
format(Msg1, 128, "{808080}PM to %s{FFFFFF}: %s", OtherPlayerName, Message);
format(Msg2, 128, "{A0A0A0}PM by %s{FFFFFF}: %s", YourName, Message);
SendClientMessage(playerid, 0xFFFFFFFF, Msg1);
SendClientMessage(OtherPlayer, 0xFFFFFFFF, Msg2);
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}You are muted");
}
else
SendClientMessage(playerid, 0xFF0000FF, "Player is not online");
}
}
else
return 0;
return 1;
}
give me rep if this commnd works
Re: PM Command - 4 Warning -
lyrics - 07.08.2011
Quote:
Originally Posted by kikito
ZCMD
PHP код:
COMMAND:pm(playerid, params[])
{
new OtherPlayer, Message[128], Msg1[128], Msg2[128], YourName[24], OtherPlayerName[24];
if (APlayerData[playerid][LoggedIn] == true)
{
if (sscanf(params, "us[128]", OtherPlayer, Message)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/pm <OtherPlayer> <Message>\"");
else
{
if (IsPlayerConnected(OtherPlayer))
{
if (APlayerData[playerid][Muted] == false)
{
GetPlayerName(playerid, YourName, sizeof(YourName));
GetPlayerName(OtherPlayer, OtherPlayerName, sizeof(OtherPlayerName));
format(Msg1, 128, "{808080}PM to %s{FFFFFF}: %s", OtherPlayerName, Message);
format(Msg2, 128, "{A0A0A0}PM by %s{FFFFFF}: %s", YourName, Message);
SendClientMessage(playerid, 0xFFFFFFFF, Msg1);
SendClientMessage(OtherPlayer, 0xFFFFFFFF, Msg2);
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}You are muted");
}
else
SendClientMessage(playerid, 0xFF0000FF, "Player is not online");
}
}
else
return 0;
return 1;
}
give me rep if this commnd works
|
Dude i need a normal command without using ZCMD
If i use ZCMD All My Commands Will Be Corrupted