12.02.2015, 14:08
Error:
Code:
This is the line error:
Quote:
warning 219: local variable "pName" shadows a variable at a preceding level |
PHP код:
public ServerRobbery()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)) // checking if player connected
{
//ROBBERIES
if(ROBBING_TATOO[i] > 1) // Checking if robbery time is above 1
{
ROBBING_TATOO[i] --; // Decreasing time
new time[20]; //adding time variable
format(time,sizeof(time),"Robbery Time: %d",ROBBING_TATOO[i]);
GameTextForPlayer(i,time,500,3); //shows gametext showing the time remaining for the robbery
}
if(ROBBING_TATOO[i] == 1) // IF the timer reached 1
{
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(i,pName,MAX_PLAYER_NAME);
SendClientMessage(i, COLOR_GREEN, "Robbery Complete"); //sending message to the player that robbery was complete
SetPlayerWantedLevel(i, GetPlayerWantedLevel(i) + 1); //giving player 1 wanted level
ROBBING_TATOO[i] =0; // RESET timer
new mrand =random(50000);
format(string,sizeof(string),"[ROBBERY] %s(%d) has robbed a total of $%d from the tatoo shop! LOL!",pName,i,mrand);
SendClientMessageToAll(COLOR_RED,string);
GivePlayerMoney(i, mrand);
}
}
}
return 1;
}
PHP код:
new string[64], pName[MAX_PLAYER_NAME];