if(pickupid == MyPickup4) { Create3DTextLabel( "Vault", 0xFFFF00AA, 2455.6977,-1706.8764,1013.5078, 50.0, 0, 1 ); if(!IsPlayerAdmin(playerid)) { GameTextForPlayer(playerid, "~r~Hardcore Cookie Is Only Allowed In", 5000, 5); SendClientMessage(playerid,0xFF0006FF,"Hardcore_Cookie Is Only Allowed In"); } else { SetPlayerPos(playerid, 2144.3212,1627.8958,993.5761); SetPlayerInterior(playerid, 1); GameTextForPlayer(playerid, "~g~Welcome ~y~To ~p~Your ~b~Vault", 5000, 5); SendClientMessage(playerid,COLOR_YELLOW,"Welcome To Your Vault"); } }
%s has entered the vault
new Name[MAX_PLAYER_NAME],String[MAX_PLAYERS];
GetPlayerName(playerid, Name, sizeof(Name));
format(String, sizeof(String), "%s entered the vault.",Name);
SendClientMessageToAll(0xBFBFBFFF, String);
C:\Users\Stephen\Desktop\serv\gamemodes\cookieserver.pwn(833) : warning 219: local variable "Name" shadows a variable at a preceding level C:\Users\Stephen\Desktop\serv\gamemodes\cookieserver.pwn(835) : error 017: undefined symbol "String" C:\Users\Stephen\Desktop\serv\gamemodes\cookieserver.pwn(835) : error 017: undefined symbol "String" C:\Users\Stephen\Desktop\serv\gamemodes\cookieserver.pwn(835) : error 029: invalid expression, assumed zero C:\Users\Stephen\Desktop\serv\gamemodes\cookieserver.pwn(835) : fatal error 107: too many error messages on one line
new Name[MAX_PLAYER_NAME],String[MAX_PLAYERS];
GetPlayerName(playerid, Name, sizeof(Name));
format(String, sizeof(String), "%s entered the vault.",Name);
SendClientMessageToAll(0xBFBFBFFF, String);
warning 219: local variable "Name" shadows a variable at a preceding level
Add new String[MAX_PLAYERS]; beside, Name[MAX_PLAYERS];
So it would look like this: pawn Код:
|
C:\Users\Stephen\Desktop\serv\gamemodes\cookieserver.pwn(833) : warning 219: local variable "Name" shadows a variable at a preceding level
warning 219: local variable "Name" shadows a variable at a preceding level
And for this:
pawn Код:
And if you want to fix that just press ctrl+f and search for new Name[MAX_PLAYERS] and delete it, then put it at the top of your script, to avoid warning like this, i suggest keep all the variables at the top of your script. Instead of making a new variable each time u need them, like "strings" which we use most, the best thing to do is define them at the top of your script. |