SA-MP Forums Archive
Warning cames up... - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Warning cames up... (/showthread.php?tid=125963)



Warning cames up... - Universal - 06.02.2010

Hey, i created one command: /jail ID Time Reason, but when i compile error comes:

Код:
warning 219: local variable "Time" shadows a variable at a preceding level
And, here is the command:

Код:
dcmd_jail(playerid,params[])
 {
 if(pInfo[playerid][AdminLevel] > 0)
 {
 #pragma unused params
 new ID, Time, Reason[30];
 if(sscanf(params,"iis",ID,Time,Reason))return SendClientMessage(playerid,GREY," Usage: /jail ID Minutes Reason");
 new AdminName[MAX_PLAYER_NAME]; GetPlayerName(playerid,AdminName,MAX_PLAYER_NAME);
 new VictimName[MAX_PLAYER_NAME]; GetPlayerName(playerid,VictimName,MAX_PLAYER_NAME);
 new Message[80]; format(Message,80,"Admin command: %s jailed [ID:%d]%s, for: %dmins. (Reason: %s )",AdminName,ID,VictimName,Time,Reason);
 SendClientMessageToAll(RED,Message);
 SetPlayerInterior(ID, 10);
 SetPlayerPos(ID ,220.5365, 115.1898, 999.0156);
 new JTime = Time*60000;
 SetTimerEx("JailRelease" , JTime, false,"i",playerid);
 pInfo[ID][Jail]=JTime;
 }
 return 1;
 }
Any ideas ?

PS. Command works, message shows perfectly, but about the warning...



Re: Warning cames up... - ¤Adas¤ - 06.02.2010

Rename the variable "Time" to "OBTime" for example.


Re: Warning cames up... - Universal - 06.02.2010

Quote:
Originally Posted by ¤Adas¤
Rename the variable "Time" to "OBTime" for example.
Oh my god, i feel so shy about this... Thank you. It worked.



Re: Warning cames up... - ¤Adas¤ - 06.02.2010

No problem :P