PM Command - 4 Warning
#1

Problem Solved!
Thanks To Gold And IPLEOMAX
Reply
#2

Its usefull if you post the warnings aswell
Reply
#3

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.
Reply
#4

It appears that pName is being repeated someone in the command
Reply
#5

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
Reply
#6

Added this :
pawn Код:
new pName[MAX_PLAYERS];
Reply
#7

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.
Reply
#8

Quote:
Originally Posted by gold
Посмотреть сообщение
Added this :
pawn Код:
new pName[MAX_PLAYERS];
Where should i put this?

And Put the Whole Code of PM + pName[MAX_PLAYERS];
Reply
#9

ZCMD
PHP код:
COMMAND:pm(playeridparams[])
{
    new 
OtherPlayerMessage[128], Msg1[128], Msg2[128], YourName[24], OtherPlayerName[24];
    if (
APlayerData[playerid][LoggedIn] == true)
    {
        if (
sscanf(params"us[128]"OtherPlayerMessage)) SendClientMessage(playerid0xFF0000AA"Usage: \"/pm <OtherPlayer> <Message>\"");
        else
        {
            if (
IsPlayerConnected(OtherPlayer))
            {
                if (
APlayerData[playerid][Muted] == false)
                {
                    
GetPlayerName(playeridYourNamesizeof(YourName));
                    
GetPlayerName(OtherPlayerOtherPlayerNamesizeof(OtherPlayerName));
                    
format(Msg1128"{808080}PM to %s{FFFFFF}: %s"OtherPlayerNameMessage);
                    
format(Msg2128"{A0A0A0}PM by %s{FFFFFF}: %s"YourNameMessage);
                    
SendClientMessage(playerid0xFFFFFFFFMsg1);
                    
SendClientMessage(OtherPlayer0xFFFFFFFFMsg2);
                }
                else
                    
SendClientMessage(playerid0xFFFFFFFF"{FF0000}You are muted");
            }
            else
                
SendClientMessage(playerid0xFF0000FF"Player is not online");
        }
    }
    else
     return 
0;
    return 
1;

give me rep if this commnd works
Reply
#10

Quote:
Originally Posted by kikito
Посмотреть сообщение
ZCMD
PHP код:
COMMAND:pm(playeridparams[])
{
    new 
OtherPlayerMessage[128], Msg1[128], Msg2[128], YourName[24], OtherPlayerName[24];
    if (
APlayerData[playerid][LoggedIn] == true)
    {
        if (
sscanf(params"us[128]"OtherPlayerMessage)) SendClientMessage(playerid0xFF0000AA"Usage: \"/pm <OtherPlayer> <Message>\"");
        else
        {
            if (
IsPlayerConnected(OtherPlayer))
            {
                if (
APlayerData[playerid][Muted] == false)
                {
                    
GetPlayerName(playeridYourNamesizeof(YourName));
                    
GetPlayerName(OtherPlayerOtherPlayerNamesizeof(OtherPlayerName));
                    
format(Msg1128"{808080}PM to %s{FFFFFF}: %s"OtherPlayerNameMessage);
                    
format(Msg2128"{A0A0A0}PM by %s{FFFFFF}: %s"YourNameMessage);
                    
SendClientMessage(playerid0xFFFFFFFFMsg1);
                    
SendClientMessage(OtherPlayer0xFFFFFFFFMsg2);
                }
                else
                    
SendClientMessage(playerid0xFFFFFFFF"{FF0000}You are muted");
            }
            else
                
SendClientMessage(playerid0xFF0000FF"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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)