Quote:
Originally Posted by Kwarde
It's quite nice, but:
pawn Код:
stock TogglePlayerMuted(playerid, toggle) { if(IsPlayerConnected(playerid)) { if(toggle == 0) { gmfuncs_PlayerInfo[playerid][Muted] = 0; } else if(toggle == 1) { gmfuncs_PlayerInfo[playerid][Muted] = 1; } } return 1; }
This could be made like this:
pawn Код:
stock TogglePlayerMuted(playerid, toggle) //Or use bool:toggle = Change [Muted] to bool too then return IsPlayerConnected(playerid) ? gmfuncs_PlayerInfo[playerid][Muted] = toggle : return 0;
How does it actually work?
pawn Код:
stock TogglePlayerMuted(playerid, toggle) { if(IsPlayerConnected(playerid) { gmfuncs_PlayerInfo[playerid][Muted] = toggle; } else { return 0; } return 1; //Not sure about this one here. }
|
What's the reason for the check if he is connected?