Szerző Téma: Mute hiba  (Megtekintve 941 alkalommal)

Nem elérhető ZSOLTI99

  • 1827
    • Profil megtekintése
Mute hiba
« Dátum: 2013. Április 12. - 19:34:02 »
0 Show voters
Mért nem némítsa le a playert? Mi a hiba benne?
 
COMMAND:mute(playerid, params[])
{
// Setup local variables
new Msg[128], Name[24], AdminName[24], Reason[128], OtherPlayer;
// Send the command to all admins so they can see it
SendAdminText(playerid, \"/mute\", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player\'s admin-level is at least 1
if (APlayerData[playerid][PlayerLevel] >= 1)
{
   if (sscanf(params, \"us[128]\", OtherPlayer, Reason)) SendClientMessage(playerid, 0xFF0000AA, \"Usage: \\\"/mute <OtherPlayer> <Reason>\\\"\");
   else
   {
      // Check if the otherplayer is online
      if (IsPlayerConnected(OtherPlayer))
      {
         // Get the player-names
         GetPlayerName(playerid, AdminName, sizeof(AdminName));
         GetPlayerName(OtherPlayer, Name, sizeof(Name));
         // Mute the other player
         APlayerData[OtherPlayer][Muted] = true;
         // Let the other player know that he has been muted
         format(Msg, 128, \"{FF0000}Te némítva lettél by {FFFF00}%s {FF0000}for {FFFF00}%s\", AdminName, Reason);
         SendClientMessage(OtherPlayer, 0xFFFFFFFF, Msg);
         // Let the admin know who he has muted
         format(Msg, 128, \"{00FF00}Némítva vagy {FFFF00}%s\", Name);
         SendClientMessage(playerid, 0xFFFFFFFF, Msg);
         // Save the player-stats
         PlayerFile_Save(OtherPlayer);
      }
      else
          SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}NIncs ilyen játékos\");
   }
}
else
    return 0;
}
else
    return 0;
// Let the server know that this was a valid command
return 1;
}

Mute hiba
« Válasz #1 Dátum: 2013. Április 12. - 21:01:42 »
0 Show voters
szerintem az OnPlayerText-el van a gond

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Mute hiba
« Válasz #2 Dátum: 2013. Április 12. - 21:19:31 »
0 Show voters
OnPlayerText függvényét másold be ott lesz tényleg a probléma.. nem kérezi le, hogy a játékos levan -e némítva..

Nem elérhető ZSOLTI99

  • 1827
    • Profil megtekintése
Mute hiba
« Válasz #3 Dátum: 2013. Április 13. - 10:14:56 »
0 Show voters
// This callback gets called whenever a player uses the chat-box
public OnPlayerText(playerid, text[])
{
// Block the player\'s text if he has been muted
    if (APlayerData[playerid][Muted] == true)
{
// Let the player know he\'s still muted
SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Te még mindig némítva vagy.\");
// Don\'t allow his text to be sent to the chatbox
return 0;
}
    return 1;
}

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Mute hiba
« Válasz #4 Dátum: 2013. Április 13. - 11:52:46 »
+1 Show voters
Porbáld meg így sok angol szöveg is ott van pedig nem is kéne.. szerintem egy kicsit tisztísd a kódot.. :D
 

COMMAND:mute(playerid, params[])
{
        new Msg[128], Name[24], AdminName[24], Reason[128], OtherPlayer;
        SendAdminText(playerid, \"/mute\", params);
        if (APlayerData[playerid][LoggedIn] == true)
        {
                if (APlayerData[playerid][PlayerLevel] >= 1)
                {
                        if (sscanf(params, \"us[128]\", OtherPlayer, Reason)) SendClientMessage(playerid, 0xFF0000AA, \"Usage: \\\"/mute <OtherPlayer> <Reason>\\\"\");
                        else
                        {
                                if (IsPlayerConnected(OtherPlayer))
                                {
                                        GetPlayerName(playerid, AdminName, sizeof(AdminName));
                                        GetPlayerName(OtherPlayer, Name, sizeof(Name));
                                        format(Msg, 128, \"{FF0000}Te némítva lettél by {FFFF00}%s {FF0000}for {FFFF00}%s\", AdminName, Reason);
                                        SendClientMessage(OtherPlayer, 0xFFFFFFFF, Msg);
                                        format(Msg, 128, \"{00FF00}Némítva vagy {FFFF00}%s\", Name);
                                        SendClientMessage(playerid, 0xFFFFFFFF, Msg);
                                        APlayerData[OtherPlayer][Muted] = true;
                                        PlayerFile_Save(OtherPlayer);
                                }
                                else SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}NIncs ilyen játékos\");
                        }
                }
                else return 0;
        } else return 0;
        return 1;
}

 
majd
 

public OnPlayerText(playerid, text[])
{
        if (APlayerData[playerid][Muted] == true)
        {
                SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Te még mindig némítva vagy.\");
                return 0;
        }
        return 1;
}

Nem elérhető ZSOLTI99

  • 1827
    • Profil megtekintése
Mute hiba
« Válasz #5 Dátum: 2013. Április 13. - 19:22:25 »
0 Show voters
Nem jó ugyan úgy tudok írni cheatba

Mute hiba
« Válasz #6 Dátum: 2013. Április 13. - 19:31:43 »
0 Show voters
Idézetet írta: ZSOLTI99 date=1365873745\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"36088\" data-ipsquote-contentclass=\"forums_Topic
Nem jó ugyan úgy tudok írni cheatba
 
Én teszteltem amit ZyZu írt és nekem jó.
Kitörölted azt a mute parancsot ami a ppcbe már benne van és kitörölted azt ami az OnPlayerText alatt van?

Nem elérhető ZSOLTI99

  • 1827
    • Profil megtekintése
Mute hiba
« Válasz #7 Dátum: 2013. Április 13. - 19:59:57 »
0 Show voters
Nem töröltem ki semmit házi szerón némít de hostoson nem némít

Dupla hozzászólás automatikusan összefûzve. ( 2013. Április 13. - 21:30:26 )

Valamiötlet?

Dupla hozzászólás automatikusan összefûzve. ( 2013. Április 13. - 21:30:59 )

Valami ötlet ?
« Utoljára szerkesztve: 2013. Április 13. - 21:30:59 írta ZSOLTI99 »

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Mute hiba
« Válasz #8 Dátum: 2013. Április 13. - 21:58:21 »
0 Show voters
az nem lehetséges.. szerintem. Lehet nem frissítetted.

Nem elérhető ZSOLTI99

  • 1827
    • Profil megtekintése
Mute hiba
« Válasz #9 Dátum: 2013. Április 13. - 22:54:49 »
0 Show voters
Pedig felmásoltam a PPC_PlayerCommands.inc és a PPC_Trucking.pwn-t is oszt nem jó

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Mute hiba
« Válasz #10 Dátum: 2013. Április 13. - 23:29:11 »
0 Show voters
miért nem írod a módba a parancsokat?  :rolleyes:

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal