Problem - 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: Problem (
/showthread.php?tid=268681)
Problem[Solved] -
CSSI - 13.07.2011
pawn Код:
public OnPlayerText(playerid, text[])
{ new file[256],PName[MAX_PLAYER_NAME];
GetPlayerName(playerid,PName,MAX_PLAYER_NAME);
format(file,sizeof(file),"/Users/%s.ini",PName);
dini_Get(file," Muted ");
if(1) return 0;
return 1;
}
warning 206: redundant test: constant expression is non-zero
Re: Problem -
Basicz - 13.07.2011
Explain more, what is the line...
pawn Код:
public OnPlayerText(playerid, text[])
{ new file[256],PName[MAX_PLAYER_NAME], isMuted[ MAX_PLAYERS ]; // added a new variable isMuted
GetPlayerName(playerid,PName,MAX_PLAYER_NAME);
format(file,sizeof(file),"/Users/%s.ini",PName);
isMuted[ playerid ] = dini_Get(file,"Muted"); // removed spaces
if( isMuted[ playerid ] == 1 ) return !SendClientMessage( playerid, -1, "You are muted" ); // changed this line
return 1;
}
Re: Problem -
CSSI - 13.07.2011
It Would be
pawn Код:
isMuted[ playerid ] = dini_Int(file,"Muted");
Thanks
It worked.