Guten Abend,
mein System funktioniert nicht.
Also wenn ich den Spieler mute, kann er nicht mehr schreiben, so sollte es auch sein.
Doch wenn die Mutezeit vorbei ist, ist der Spieler immer noch gemuted...
Mute Befehl:
COMMAND:mute(playerid,params[])
{
new pID,grund[64],dauer;
if(!isAnAdmin(playerid,1)) return SendClientMessage(playerid,GRAU,ADMINMELDUNG);
if(sscanf(params, "us[64]i", pID, grund,dauer))return SendClientMessage(playerid, GRAU, "BENUTZE: /mute [SpielerName/ID] [Grund] [Dauer]");
muteplayer(playerid,grund,dauer,pID);
return 1;
}
Stock MutePlayer
stock muteplayer(playerid,const string[],dauer,pID)
{
new timestamp,str[264];
timestamp = gettime();
new sekunden = dauer * 60;
timestamp += sekunden;
new name[MAX_PLAYER_NAME],pIDName[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
GetPlayerName(pID,pIDName,sizeof(pIDName));
format(str,sizeof(str),"[MUTE]: Der Admin %s hat %s für %d Minuten gemuted, Grund: %s",name,pIDName,dauer,string);
SendClientMessageToAll(ROT,str);
User[pID][MuteTime] = timestamp;
User[pID][Mute] = 1;
return 1;
}
UnMuteTimer
forward UnMuteTimer();
SetTimer("UnMuteTimer",60000,1);
public UnMuteTimer ()
{
for(new i;i<MAX_PLAYERS;i++)
{
new timestampMute = gettime();
new bisgemuted = User[i][MuteTime];
if(timestampMute > bisgemuted)
{
User[i][Mute] = 0;
return 1;
}
}
return 1;
}
SavePlayerData:
stock SavePlayerData(playerid)
{
new query[264 + MAX_PLAYER_NAME];
new day,month,year; getdate(year,month,day);
format(User[playerid][LastLogin],11,"%d/%d/%d",day,month,year);
mysql_format(mycon,query, sizeof(query), "UPDATE `User` SET `Geld` = %d,`Level` = %d,`Adminlevel` = %d,`TimeBan` = %d,`Kills` = %d,`Tode` = %d,`Skin` = %d,`Coins` = '%d',`EXP` = '%d',`LastLogin` = '%e', `Premium` = '%d', `PremiumZeit` = '%d', `MuteTime` = '%d', `Mute` = '%d' WHERE `Name` = '%e'",User[playerid][Geld],User[playerid][Level],User[playerid][Admin],User[playerid][TimeBan],User[playerid][Kills],User[playerid][Tode],
User[playerid][Skin],User[playerid][Coins],User[playerid][LevelPunkte],
User[playerid][LastLogin],User[playerid][Donator],User[playerid][DonatorBis],User[playerid][MuteTime],User[playerid][Mute],User[playerid][Username]);
mysql_tquery(mycon,query,"","");
return 1;
}
LoadPlayerData
new timestampMute = gettime();
new bisgemuted = User[playerid][MuteTime] = cache_get_field_content_int(0,"MuteTime");
if(timestampMute > bisgemuted)
{
User[playerid][Mute] = 0;
SendClientMessage(playerid,GELB,"[MUTEINFO] Du kannst nun wieder schreiben");
}