Jump to content
  • 0

Problema /event


Scott_Williams

Question

Salut , am o problema am o comanda event , si o poate folosi doar admini care sunt onduty , dar vreau sa o fac sa o poata folosi si playeri de lvl 3 nu doar admini Ajutatima va rog! Multumesc

//-------------------------------------[Event Info]-----------------------------------------------------

    if(strcmp(cmd, "/event", true) == 0)

{

if (PlayerInfo[playerid][pLevel] >= 3)

{

    if(AdminDuty[playerid] == 1)

    {

                      GetPlayerName(playerid, sendername, sizeof(sendername));

          format(string, sizeof(string), "[Event Info] %s [iD:%d] Event over !.", sendername,playerid);

                      SendClientMessageToAll(COLOR_ORANGE,string);

        AdminDuty[playerid] = 0;

      SetPlayerHealth(playerid,100);

      SetPlayerArmour(playerid,0);

      SetPlayerToTeamColor(playerid);

  }

    else

    {

                GetPlayerName(playerid, sendername, sizeof(sendername));

    format(string, sizeof(string), "[Event Info] %s [iD:%d] Face event la punctul portocaliu /w %s pentru detalii.",sendername,playerid);

SendClientMessageToAll(COLOR_ORANGE,string);

AdminDuty[playerid] = 1;

SetPlayerHealth(playerid,100);

SetPlayerArmour(playerid,50);

SetPlayerColor(playerid,COLOR_ORANGE);

for(new i = 0; i < MAX_PLAYERS; i ++)

      {

        if(IsPlayerConnected(i))

        {

      SetPlayerMarkerForPlayer( i,playerid,COLOR_ORANGE );

    }

      }

    }

}

else

return 1;

}

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

#include <a_samp>
#include <core>
#include <float>

new glob0[500];

#define MAX_STRING 255

public OnPlayerConnect(playerid)
{
   glob0[playerid] = 0;
   return 0;
}

strtok(const string[], &index,seperator=' ')
{
   new length = strlen(string);
   new offset = index;
   new result[MAX_STRING];
   while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
   {
      result[index - offset] = string[index];
      index++;
   }

   result[index - offset] = EOS;
   if ((index < length) && (string[index] == seperator))
   {
      index++;
   }
   return result;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
   new var0[256];
   new var1[24];
   new var2[256];
   new var3 = 0;
   var2 = strtok(cmdtext, var3);
   if(!strcmp(var2, "/event", true))
   {
      if(glob0[playerid] == 1)
      {
         GetPlayerName(playerid, var1, 24);
         format(var0, 256, "[Event Info] %s [ID:%d] Eventul sa terminat !", var1, playerid);
         SendClientMessageToAll(0xFF8000FF, var0);
         glob0[playerid] = 0;
         SetPlayerHealth(playerid, 100.0);
         SetPlayerArmour(playerid, 0.0);
         SetPlayerColor(playerid, 0xFF0000FF);
      }
      else
      {
         GetPlayerName(playerid, var1, 24);
         format(var0, 256, "[Event Info] %s [ID:%d] Face event la punctul Portocaliu. ", var1, playerid);
         SendClientMessageToAll(0xFF8000FF, var0);
         glob0[playerid] = 1;
         SetPlayerHealth(playerid, 100.0);
         SetPlayerArmour(playerid, 50.0);
         SetPlayerColor(playerid, 0xFF8000FF);
         for(new var4 = 0; var4 < 500; var4++)
         {
            if(IsPlayerConnected(var4))
            {
               SetPlayerMarkerForPlayer(var4, playerid, 0xFF0000FF);
            }
         }
      }
      return 1;
   }
   return 0;
}

Uite aici o comanda /event by me ;|

Link to comment
Share on other sites

#include <a_samp>
#include <core>
#include <float>

new glob0[500];

#define MAX_STRING 255

public OnPlayerConnect(playerid)
{
   glob0[playerid] = 0;
   return 0;
}

strtok(const string[], &index,seperator=' ')
{
   new length = strlen(string);
   new offset = index;
   new result[MAX_STRING];
   while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
   {
      result[index - offset] = string[index];
      index++;
   }

   result[index - offset] = EOS;
   if ((index < length) && (string[index] == seperator))
   {
      index++;
   }
   return result;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
   new var0[256];
   new var1[24];
   new var2[256];
   new var3 = 0;
   var2 = strtok(cmdtext, var3);
   if(!strcmp(var2, "/event", true))
   {
      if(glob0[playerid] == 1)
      {
         GetPlayerName(playerid, var1, 24);
         format(var0, 256, "[Event Info] %s [ID:%d] Eventul sa terminat !", var1, playerid);
         SendClientMessageToAll(0xFF8000FF, var0);
         glob0[playerid] = 0;
         SetPlayerHealth(playerid, 100.0);
         SetPlayerArmour(playerid, 0.0);
         SetPlayerColor(playerid, 0xFF0000FF);
      }
      else
      {
         GetPlayerName(playerid, var1, 24);
         format(var0, 256, "[Event Info] %s [ID:%d] Face event la punctul Portocaliu. ", var1, playerid);
         SendClientMessageToAll(0xFF8000FF, var0);
         glob0[playerid] = 1;
         SetPlayerHealth(playerid, 100.0);
         SetPlayerArmour(playerid, 50.0);
         SetPlayerColor(playerid, 0xFF8000FF);
         for(new var4 = 0; var4 < 500; var4++)
         {
            if(IsPlayerConnected(var4))
            {
               SetPlayerMarkerForPlayer(var4, playerid, 0xFF0000FF);
            }
         }
      }
      return 1;
   }
   return 0;
}

Uite aici o comanda /event by me ;|

nu e de tine, ci e furata cu DEAMX.

PROBLEME GODFATHER

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.