26.08.2017, 00:29
Hi,
I converted some commands from STRCMP to ZMCD, but adding the commands to the gm drops warnings, and i wanna know why this is happening.
PD: I'm putting the commands at the end of the gamemode
The warnings:
"GM.pwn(3080) : warning 219: local variable "msg" shadows a variable at a preceding level"
"GM.pwn(4684) : warning 219: local variable "msg" shadows a variable at a preceding level"
Here's the line 4684:
Here's the line 3080:
I converted some commands from STRCMP to ZMCD, but adding the commands to the gm drops warnings, and i wanna know why this is happening.
PD: I'm putting the commands at the end of the gamemode
The warnings:
"GM.pwn(3080) : warning 219: local variable "msg" shadows a variable at a preceding level"
"GM.pwn(4684) : warning 219: local variable "msg" shadows a variable at a preceding level"
Here's the line 4684:
PHP код:
CMD:claimcoupon(playerid, params[])
{
new title[64], msg[126];//Line 4684
format(title,sizeof(title),"{1B8AE4}Claim Coupon");
format(msg,sizeof(msg),"Type the coupon code below to\nclaim your reward:");
ShowPlayerDialog(playerid, coupon1, DIALOG_STYLE_INPUT, title, msg, "Claim", "Cancel");
return 1;
}
PHP код:
public HouseEnter(playerid, houseid)
{
if(PInfo[playerid][House1] == HInfo[houseid][hHouseID]) { new msg[64]; format(msg,sizeof(msg),"Welcome %s.", PlayerName(playerid)); SendClientMessage(playerid, COLOR_WHITE, msg); }//Line 3080
if(PInfo[playerid][House2] == HInfo[houseid][hHouseID]) { new msg[64]; format(msg,sizeof(msg),"Welcome home, %s.", PlayerName(playerid)); SendClientMessage(playerid, COLOR_WHITE, msg); }
InHouse[playerid] = houseid;
SetPlayerInterior(playerid, HInfo[houseid][hInterior]);
SetPlayerPos(playerid, HInfo[houseid][hiX],HInfo[houseid][hiY],HInfo[houseid][hiZ]);
SetPlayerVirtualWorld(playerid, houseid);
return 1;
}