Keine Client Message!

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hallo!


    Ich möchte mal fragen warum nach einem Bann/Kick die ClientMessage nicht kommt? also da ist einfach "Server Closed the Connection"


    CODE:



    CMD:kick(playerid,params[]) { if(PlayerInfo[playerid][LoggedIn] == 1) { if(PlayerInfo[playerid][Level] >= 1 || PlayerInfo[playerid][Helper] == 1) { new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /kick [playerid] [reason]"); new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128]; player1 = strval(tmp);
    if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) { GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname)); CMDMessageToAdmins(playerid,"KICK"); if(PlayerInfo[playerid][LoggedIn] == 1) { if(PlayerInfo[playerid][Level] >= 1) { if(isnull(tmp2)) { format(string,sizeof(string),"%s has been kicked by Administrator %s ",playername,adminname,params[2]); SendClientMessageToAll(red,string); format(string,sizeof(string),"[ No Reason Given ]",params[2]); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); print(string); return Kick(player1); } else { format(string,sizeof(string),"%s has been kicked by Administrator %s ",playername,adminname,params[2]); SendClientMessageToAll(red,string); format(string,sizeof(string),"[ Reason: %s ]",params[2]); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); print(string); return Kick(player1); } } } if(PlayerInfo[playerid][Helper] == 1) { if(isnull(tmp2)) { format(string,sizeof(string),"%s has been kicked by Help moderator %s [no reason given] ",playername,adminname); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); print(string); return Kick(player1); } else { format(string,sizeof(string),"%s has been kicked by Help moderator %s [reason: %s] ",playername,adminname,params[2]); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); print(string); return Kick(player1); } } } else return SendClientMessage(playerid, red, "Player is not connected or is yourself or is the highest level admin"); } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command"); } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands"); return 1;}





    CMD:kick(playerid,params[]) { if(PlayerInfo[playerid][LoggedIn] == 1) { if(PlayerInfo[playerid][Level] >= 1 || PlayerInfo[playerid][Helper] == 1) { new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /kick [playerid] [reason]"); new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128]; player1 = strval(tmp);
    if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) { GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname)); CMDMessageToAdmins(playerid,"KICK"); if(PlayerInfo[playerid][LoggedIn] == 1) { if(PlayerInfo[playerid][Level] >= 1) { if(isnull(tmp2)) { format(string,sizeof(string),"%s has been kicked by Administrator %s ",playername,adminname,params[2]); SendClientMessageToAll(red,string); format(string,sizeof(string),"[ No Reason Given ]",params[2]); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); print(string); return Kick(player1); } else { format(string,sizeof(string),"%s has been kicked by Administrator %s ",playername,adminname,params[2]); SendClientMessageToAll(red,string); format(string,sizeof(string),"[ Reason: %s ]",params[2]); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); print(string); return Kick(player1); } } } if(PlayerInfo[playerid][Helper] == 1) { if(isnull(tmp2)) { format(string,sizeof(string),"%s has been kicked by Help moderator %s [no reason given] ",playername,adminname); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); print(string); return Kick(player1); } else { format(string,sizeof(string),"%s has been kicked by Help moderator %s [reason: %s] ",playername,adminname,params[2]); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); print(string); return Kick(player1); } } } else return SendClientMessage(playerid, red, "Player is not connected or is yourself or is the highest level admin"); } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command"); } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands"); return 1;}



    und ehh Time mute kann ich iwie auch nicht, erbitte hilfe!!!


    CODE:










    CMD:mute(playerid,params[]) { if(PlayerInfo[playerid][LoggedIn] == 1) { if(PlayerInfo[playerid][Level] >= 2) { new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /mute [playerid] [reason]"); new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128]; player1 = strval(tmp);
    if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) { if(PlayerInfo[player1][Muted] == 0) { GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname)); CMDMessageToAdmins(playerid,"MUTE"); PlayerPlaySound(player1,1057,0.0,0.0,0.0); PlayerInfo[player1][Muted] = 1; PlayerInfo[player1][MuteWarnings] = 0;
    if(strlen(tmp2)) { format(string,sizeof(string),"You have been muted by Administrator %s [reason: %s]",adminname,params[2]); SendClientMessage(player1,blue,string); format(string,sizeof(string),"You have muted %s [reason: %s]", playername,params[2]); return SendClientMessage(playerid,blue,string); } else { format(string,sizeof(string),"You have been muted by Administrator %s",adminname); SendClientMessage(player1,blue,string); format(string,sizeof(string),"You have muted %s", playername); return SendClientMessage(playerid,blue,string); } } else return SendClientMessage(playerid, red, "Player is already muted"); } else return SendClientMessage(playerid, red, "Player is not connected or is the highest level admin"); } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command"); } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");}


















    MFG

    Einmal editiert, zuletzt von KlaTschI ()


  • Im 2. Link steht doch die Lösung schon gescriptet. Musst es halt nur auf dein System anpassen. So schwer ist das doch nicht. ;)





    CMD:kick(playerid,params[])
    {
    if(SpielerInfo[playerid][pAdmin] < 1)return SendClientMessage(playerid,COLOR_RED,"You aren't Authorized to use this Command!");
    new pID,Name[MAX_PLAYER_NAME],kName[MAX_PLAYER_NAME],reason[100],string[150];
    GetPlayerName(playerid,Name, sizeof(Name));
    GetPlayerName(pID,kName, sizeof(kName)); CMDMessageToAdmins(playerid,"KICK");
    if(sscanf(params,"us",pID,reason))return SendClientMessage(playerid,COLOR_GREY,"USAGE: /kick [ID] [REASON/WITH]");
    format(string, sizeof(string),"Adminstrator %s has Kicked user %s! Reason: %d",kName, Name,reason);
    SendClientMessageToAll(COLOR_RED,string);
    SendClientMessage(pID,COLOR_RED,"You have been Kicked by an Adminstrator/Server!");
    SpielerInfo[pID][pKicks] ++;
    SavePlayer(pID);
    _Kick(pID);
    return 1;
    }


    forward KickPlayer(playerid);
    public KickPlayer(playerid){Kick(playerid);}


    forward _Kick(playerid);
    public _Kick(playerid)
    {SetTimerEx("KickPlayer",500,0,"i",playerid);}









    [size=10]


    [size=14]So??


  • CMD:kick(playerid,params[])
    {
    if(SpielerInfo[playerid][pAdmin] < 1)return SendClientMessage(playerid,COLOR_RED,"You aren't Authorized to use this Command!");
    new pID,Name[MAX_PLAYER_NAME],kName[MAX_PLAYER_NAME],reason[100],string[150];
    GetPlayerName(playerid,Name, sizeof(Name));
    GetPlayerName(pID,kName, sizeof(kName)); CMDMessageToAdmins(playerid,"KICK");
    if(sscanf(params,"us",pID,reason))return SendClientMessage(playerid,COLOR_GREY,"USAGE: /kick [ID] [REASON/WITH]");
    format(string, sizeof(string),"Adminstrator %s has Kicked user %s! Reason: %d",kName, Name,reason);
    SendClientMessageToAll(COLOR_RED,string);
    SendClientMessage(pID,COLOR_RED,"You have been Kicked by an Adminstrator/Server!");
    SpielerInfo[pID][pKicks] ++;
    SavePlayer(pID);
    SetTimerEx("_Kick",100,0,"i",pID);
    return 1;
    }


    forward _Kick(playerid);
    public _Kick(playerid)
    {Kick(playerid);}

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • Haste auch Mute und TBAN SYSTEM? (mute mit timer also 1 minute also in minuten?)

  • Erstell dir einfach eine Funktion die den Spieler kickt. (public / forward)
    Danach erstellst du einen extendet Timer (%i) und lässt die Funktion nach 1sek. abrufen.
    Geh dabei sicher das du die Nachrichten mit dem Timer sendest.



    kick{ nachricht, timer 1 sek. }
    func{ kick player }