Szerző Téma: Szöveg kiírása playernél  (Megtekintve 1234 alkalommal)

Nem elérhető ZSOLTI99

  • 1827
    • Profil megtekintése
Szöveg kiírása playernél
« Dátum: 2013. Július 10. - 17:08:17 »
0 Show voters
Hello. Valaki tudna segíteni nem írja ki a szöveget pl le lettél bannolva pedig oda van írva a /ban /ipban /kick se írja ki valaki tudja az írjon.
 
COMMAND:kick(playerid, params[])
{
new PlayerToKick, Reason[128], ReasonMsg[128], Name[24];
// Send the command to all admins so they can see it
SendAdminText(playerid, \"/kick\", 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]\", PlayerToKick, Reason)) SendClientMessage(playerid, 0xFF0000AA, \"Hasznalta: \\\"/kick <PlayerToKick> <Reason>\\\"\");
   else
      if (IsPlayerConnected(PlayerToKick)) // If the player is a valid playerid (he\'s connected)
      {
         // Get the name of the player who warned the player
         GetPlayerName(playerid, Name, sizeof(Name));
         // Send the warned player a message who kicked him and why he\'s been kicked
         format(ReasonMsg, 128, \"Te kickelve lettél by %s %s\", AdminLevelName[APlayerData[playerid][PlayerLevel]], Name);
         SendClientMessage(PlayerToKick, 0xFF0000FF, ReasonMsg);
         format(ReasonMsg, 128, \"Reason: %s\", Reason);
         SendClientMessage(PlayerToKick, 0xFF0000FF, ReasonMsg);
         // Kick the player
         Kick(PlayerToKick);
      }
      else
          SendClientMessage(playerid, 0xFF0000FF, \"Nincs játékos\");
}
else
    return 0;
}
else
    return 0;
// Let the server know that this was a valid command
return 1;
}

 

COMMAND:ban(playerid, params[])
{
// Setup local variables
new PlayerToBan, Days, Hours, Reason[128], TotalBanTime, Msg[128], Name[24], AdminName[24];
// Send the command to all admins so they can see it
SendAdminText(playerid, \"/ban\", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player\'s admin-level is at least 3
if (APlayerData[playerid][PlayerLevel] >= 3)
{
   if (sscanf(params, \"uiis[128]\", PlayerToBan, Days, Hours, Reason))
      SendClientMessage(playerid, 0xFF0000AA, \"Használd: \\\"/ban <PlayerToBan> <nap> <óra> <Ok>\\\"\");
   else
   {
      if (IsPlayerConnected(PlayerToBan))
      {
         // Get the names of the player and the admin who executed the ban
         GetPlayerName(playerid, AdminName, sizeof(AdminName));
         GetPlayerName(PlayerToBan, Name, sizeof(Name));
         // Increase the number of bans
         APlayerData[PlayerToBan][bans]++;
         // Calculate the total bantime (when the player can login again)
         TotalBanTime = (Days * 86400) + (Hours * 3600) + gettime();
         // Check if this is the player\'s 5th ban
         if (APlayerData[PlayerToBan][bans] == 5)
            APlayerData[PlayerToBan][banTime] = 2147483640; // Make the ban permanent (as high as it can go)
         else
            APlayerData[PlayerToBan][banTime] = TotalBanTime; // Store this value for the player
         // Inform the player about his ban
         if (APlayerData[PlayerToBan][bans] == 5)
         {
            format(Msg, 128, \"Te bannolva lettél by %s, mivel 5x bannolva lettõl\", AdminName);
            SendClientMessage(PlayerToBan, 0x808080FF, Msg);
         }
         else
         {
            format(Msg, 128, \"Bannolt: %s idõre %i nap és %i óra\", AdminName, Days, Hours);
            SendClientMessage(PlayerToBan, 0xFFFF00FF, Msg);
            format(Msg, 128, \"Reason: %s\", Reason);
            SendClientMessage(PlayerToBan, 0xFFFF00FF, Msg);
            format(Msg, 128, \"You\'ve been banned %i times now, 5th time is permament\", APlayerData[PlayerToBan][bans]);
            SendClientMessage(PlayerToBan, 0xFFFF00FF, Msg);
         }
         // Kick the player (his data will be saved)
         Kick(PlayerToBan);
         // Inform everybody else which player was banned and for how long
         format(Msg, 128, \"%s %s Bannolt %s Idõre %i nap %i óra\", AdminLevelName[APlayerData[playerid][PlayerLevel]], AdminName, Name, Days, Hours);
         SendClientMessageToAll(0x808080FF, Msg);
      }
   }
}
else
    return 0;
}
else
    return 0;
return 1;
}

 

COMMAND:ipban(playerid, params[])
{
// Setup local variables
new PlayerToBan, Reason[128], Msg[128], Name[24], AdminName[24];
// Send the command to all admins so they can see it
SendAdminText(playerid, \"/ipban\", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player\'s admin-level is at least 3
if (APlayerData[playerid][PlayerLevel] >= 3)
{
   if (sscanf(params, \"us[128]\", PlayerToBan, Reason))
      SendClientMessage(playerid, 0xFF0000AA, \"Használd: \\\"/ipban <PlayerToBan> <Reason>\\\"\");
   else
   {
      if (IsPlayerConnected(PlayerToBan))
      {
         // Get the names of the player and the admin who executed the ban
         GetPlayerName(playerid, AdminName, sizeof(AdminName));
         GetPlayerName(PlayerToBan, Name, sizeof(Name));
         // Inform the player about his ban
         format(Msg, 128, \"{FF0000}A te IP címed bannolva lett by {FFFF00}%s\", AdminName);
         SendClientMessage(PlayerToBan, 0xFFFFFFFF, Msg);
         format(Msg, 128, \"{FF0000}Reason: {FFFF00}%s\", Reason);
         SendClientMessage(PlayerToBan, 0xFFFFFFFF, Msg);
         // Ban the player with a reason
         BanEx(PlayerToBan, Reason);
         // Inform everybody else which player was ip-banned
         format(Msg, 128, \"{808080}%s %s has ip-banned {FFFF00}%s\", AdminLevelName[APlayerData[playerid][PlayerLevel]], AdminName, Name);
         SendClientMessageToAll(0xFFFFFFFF, Msg);
      }
   }
}
else
    return 0;
}
else
    return 0;
return 1;
}

Szöveg kiírása playernél
« Válasz #1 Dátum: 2013. Július 10. - 17:25:26 »
0 Show voters
Rakjál bele 1 mp-es timert, azt forward-hoz rakd a Kick(PlayerToKick); részt.

Nem elérhető ZSOLTI99

  • 1827
    • Profil megtekintése
Szöveg kiírása playernél
« Válasz #2 Dátum: 2013. Július 10. - 20:16:49 »
0 Show voters
És akkor jó lesz?

Szöveg kiírása playernél
« Válasz #3 Dátum: 2013. Július 10. - 20:53:56 »
0 Show voters

Nem elérhető ZSOLTI99

  • 1827
    • Profil megtekintése
Szöveg kiírása playernél
« Válasz #4 Dátum: 2013. Július 11. - 18:33:05 »
0 Show voters
De ha ezt berakom akkor kapok 1 errort tudnál írni egy példát?

Nem elérhető BoOy

  • 3209
  • 2013-as év szkriptere
    • Profil megtekintése
Szöveg kiírása playernél
« Válasz #5 Dátum: 2013. Július 12. - 00:13:30 »
0 Show voters
Idézetet írta: ZSOLTI99 date=1373560385\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"39532\" data-ipsquote-contentclass=\"forums_Topic
De ha ezt berakom akkor kapok 1 errort tudnál írni egy példát?
 
Példa:
 

forward ujTimer(playerid);
COMMAND:kick(playerid, params[])
{
new PlayerToKick, Reason[128], ReasonMsg[128], Name[24];
// Send the command to all admins so they can see it
SendAdminText(playerid, \"/kick\", 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]\", PlayerToKick, Reason)) SendClientMessage(playerid, 0xFF0000AA, \"Hasznalta: \\\"/kick <PlayerToKick> <Reason>\\\"\");
   else
      if (IsPlayerConnected(PlayerToKick)) // If the player is a valid playerid (he\'s connected)
      {
         // Get the name of the player who warned the player
         GetPlayerName(playerid, Name, sizeof(Name));
         // Send the warned player a message who kicked him and why he\'s been kicked
         format(ReasonMsg, 128, \"Te kickelve lettél by %s %s\", AdminLevelName[APlayerData[playerid][PlayerLevel]], Name);
         SendClientMessage(PlayerToKick, 0xFF0000FF, ReasonMsg);
         format(ReasonMsg, 128, \"Reason: %s\", Reason);
         SendClientMessage(PlayerToKick, 0xFF0000FF, ReasonMsg);
         SetTimerEx(\"ujTimer\",1500,0,\"i\",PlayerToKick);
      }
      else
          SendClientMessage(playerid, 0xFF0000FF, \"Nincs játékos\");
}
else
    return 0;
}
else
    return 0;
// Let the server know that this was a valid command
return 1;
}
public ujTimer(playerid)
{
         Kick(playerid);
         return 1;
}

Nem elérhető ZSOLTI99

  • 1827
    • Profil megtekintése
Szöveg kiírása playernél
« Válasz #6 Dátum: 2013. Július 12. - 11:06:31 »
0 Show voters
Óóó zseni vagy mûködik is akkor meg is csinálom a többit köszönöm szépen

Dupla hozzászólás automatikusan összefûzve. ( 2013. Július 12. - 11:41:59 )

D:\\GTA modok\\Mod\\Maddddd\\Mad\\régi\\régi\\pawno\\include\\PPC_PlayerCommands.inc(4796) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase
 
4 Warnings.

 
kaptam egy warningot mit lehetne vele kezdeni?
 
forward ujTimer2(playerid);
// Bans a player by his ip
COMMAND:ipban(playerid, params[])
{
// Setup local variables
new PlayerToBan, Reason[128], Msg[128], Name[24], AdminName[24];
// Send the command to all admins so they can see it
SendAdminText(playerid, \"/ipban\", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player\'s admin-level is at least 3
if (APlayerData[playerid][PlayerLevel] >= 3)
{
   if (sscanf(params, \"us[128]\", PlayerToBan, Reason))
      SendClientMessage(playerid, 0xFF0000AA, \"Használd: \\\"/ipban <PlayerToBan> <Reason>\\\"\");
   else
   {
      if (IsPlayerConnected(PlayerToBan))
      {
         // Get the names of the player and the admin who executed the ban
         GetPlayerName(playerid, AdminName, sizeof(AdminName));
         GetPlayerName(PlayerToBan, Name, sizeof(Name));
         // Inform the player about his ban
         format(Msg, 128, \"{FF0000}A te IP címed bannolva lett by {FFFF00}%s\", AdminName);
         SendClientMessage(PlayerToBan, 0xFFFFFFFF, Msg);
         format(Msg, 128, \"{FF0000}Reason: {FFFF00}%s\", Reason);
         SendClientMessage(PlayerToBan, 0xFFFFFFFF, Msg);
         SetTimerEx(\"ujTimer2\",1000,0,\"i\",PlayerToBan);
         // Ban the player with a reason
         // Inform everybody else which player was ip-banned
         format(Msg, 128, \"{808080}%s %s has ip-banned {FFFF00}%s\", AdminLevelName[APlayerData[playerid][PlayerLevel]], AdminName, Name);
         SendClientMessageToAll(0xFFFFFFFF, Msg);
      }
   }
}
else
    return 0;
}
else
    return 0;
return 1;
}
public ujTimer2(playerid)
{
 BanEx(playerid); //Kick(playerid);
         return 1;
}
« Utoljára szerkesztve: 2013. Július 12. - 11:41:59 írta ZSOLTI99 »

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
Szöveg kiírása playernél
« Válasz #7 Dátum: 2013. Július 12. - 15:10:51 »
0 Show voters
Melyik sor?

Nem elérhető ZSOLTI99

  • 1827
    • Profil megtekintése
Szöveg kiírása playernél
« Válasz #8 Dátum: 2013. Július 12. - 16:02:36 »
0 Show voters
Itt erre jelszi a hibát
public ujTimer2(playerid) 
{
 BanEx(playerid); //Kick(playerid);
         return 1;
}

 
ez a 4796 sor

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
Szöveg kiírása playernél
« Válasz #9 Dátum: 2013. Július 12. - 17:13:48 »
0 Show voters
                 BanEx(playerid); //Kick(playerid);

 
ezt.. erre:
 
                 BanEx(playerid, \"Hack\"); //Kick(playerid);

Nem elérhető ZSOLTI99

  • 1827
    • Profil megtekintése
Szöveg kiírása playernél
« Válasz #10 Dátum: 2013. Július 12. - 19:12:12 »
0 Show voters
Kösz mûködik és még annyi lenne mi a legkissebb idõzítõ szám?

xD1999

  • Vendég
Szöveg kiírása playernél
« Válasz #11 Dátum: 2013. Július 12. - 19:18:35 »
0 Show voters
Hát az a 1 de van OnPlayerUpdate de az laggoltatná a szerverz + elég 1 mp-s timer neki mert ha kevesebb lesz akkor laggos sz*r lesz a szervered
« Utoljára szerkesztve: 2013. Július 13. - 12:07:28 írta ScreaM »

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
Szöveg kiírása playernél
« Válasz #12 Dátum: 2013. Július 12. - 21:32:24 »
0 Show voters
Elég rá 3 másodperces (3000) timer bõven.

Nem elérhető ZSOLTI99

  • 1827
    • Profil megtekintése
Szöveg kiírása playernél
« Válasz #13 Dátum: 2013. Július 13. - 09:37:12 »
0 Show voters
Oké kösz mindent mûködik

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal