need help - 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)
+--- Thread: need help (
/showthread.php?tid=482003)
need help -
iThePunisher - 18.12.2013
im getting this error , can anyone help me in this?
pawn Код:
C:\Users\derhaker\Desktop\my script\gamemodes\start.pwn(4463) : warning 219: local variable "Time" shadows a variable at a preceding level
pawn Код:
@Release(playerid);
@Release(playerid)
{
new string[120];
new Time = GetPVarInt(playerid, "JailTime");
if(!IsPlayerConnected(playerid))
return 0;
if(Time < 1)
{
SetPVarInt(playerid, "Jailed", 0);
SetPlayerInterior(playerid, 6);
SetPlayerPos(playerid, 246.5301,86.7577,1003.6406);
SetPlayerFacingAngle(playerid, 176.7961);
SetPlayerHealth(playerid,100);
format(string,sizeof(string),"%s(%d) Has been realesed from Los Santos Jail after %d",PlayerInfo(playerid),playerid,GetPVarInt(playerid, "JailTime"),playerid);
SendClientMessageToAll(COLOR_ORANGE,string);
return 1;
}
new str[30];
format(str, sizeof(str), "You will be released in: %d", Time);
GameTextForPlayer(playerid, str, 2500, 3); // Change it if you want
SetPVarInt(playerid, "JailTime", Time - 1); // Decrease the player's jail time
SetTimerEx("@Release", 1000, false, "i", playerid);
return 1;
}
Re: need help -
Tayab - 18.12.2013
That means there's Time variable already defined for something else.
Just change the "Time" to "TimeX"
pawn Код:
@Release(playerid);
@Release(playerid)
{
new string[120];
new TimeX = GetPVarInt(playerid, "JailTime");
if(!IsPlayerConnected(playerid))return 0;
if(Time < 1)
{
SetPVarInt(playerid, "Jailed", 0);
SetPlayerInterior(playerid, 6);
SetPlayerPos(playerid, 246.5301,86.7577,1003.6406);
SetPlayerFacingAngle(playerid, 176.7961);
SetPlayerHealth(playerid,100);
format(string,sizeof(string),"%s(%d) Has been realesed from Los Santos Jail after %d",PlayerInfo(playerid),playerid,GetPVarInt(playerid, "JailTime"),playerid);
SendClientMessageToAll(COLOR_ORANGE,string);
return 1;
}
new str[30];
format(str, sizeof(str), "You will be released in: %d", TimeX);
GameTextForPlayer(playerid, str, 2500, 3); // Change it if you want
SetPVarInt(playerid, "JailTime", TimeX - 1); // Decrease the player's jail time
SetTimerEx("@Release", 1000, false, "i", playerid);
return 1;
}
Re: need help -
iThePunisher - 18.12.2013
everything is fixed thank you
+1 reputation