Jump to content
×
×
  • Create New...

CMD : /taule


Recommended Posts

Centre de Téléchargement

Télécharger ( Interne )

Bonjour,

 

Aujourd'hui je vous présente la commande /taule .

Car j'ai vu qu'elle était beugué sur certain Serveur.

 

if(strcmp(cmd, "/taule", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_GRAD2, "[CMD]: /taule [iD] [temps(minutes] [raison]");
			return 1;
		}
		new playa;
		new money;
		playa = ReturnUser(tmp);
		tmp = strtok(cmdtext, idx);
		money = strval(tmp);
		if (PlayerInfo[playerid][pAdmin] >= 1000)
		{
		    if(IsPlayerConnected(playa))
		    {
		        if(playa != INVALID_PLAYER_ID)
		        {
			        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof(sendername));
					new length = strlen(cmdtext);
					while ((idx < length) && (cmdtext[idx] <= ' '))
					{
						idx++;
					}
					new offset = idx;
					new result[82];
					while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
					{
						result[idx - offset] = cmdtext[idx];
						idx++;
					}
					result[idx - offset] = EOS;
					if(!strlen(result))
					{
						SendClientMessage(playerid, COLOR_GRAD2, "[CMD]: /taule [iD] [temps(minutes)] [Raison]");
						return 1;
					}
					format(string, sizeof(string), "* Vous mettez en prison %s.", giveplayer);
					SendClientMessage(playerid, COLOR_LIGHTRED, string);
					format(string, sizeof(string), "* Vous êtes envoyé en prison par Administrateur.", sendername);
					SendClientMessage(playa, COLOR_LIGHTRED, string);
					SafeResetPlayerWeapons(playa);
					WantedPoints[playa] = 0;
					PlayerInfo[playa][pJailed] = 1;
					PlayerInfo[playa][pJailTime] = money*60;
					SetPlayerInterior(playa, 0);
					PlayerInfo[playa][pInt] = 0;
					SetPlayerVirtualWorld (playa, 1);
					SetPlayerPos(playa, 1764.8106,-1542.6401,9.3901);
					SetPlayerSkin(playa, 268);
					format(string, sizeof(string), "Vous êtes en prison pendant %d minutes. Bail: Indiscutable", money);
					SendClientMessage(playa, COLOR_WHITE, string);
					SendClientMessage(playa, COLOR_WHITE, "Gardien: Voici ta tenue de prisonnier,Bon sejour! **rigole");
					format(string, 256, "[iNFO] %s a été emprisonné par Administrateur [Raison: %s]", giveplayer, (result));
					BroadCast(COLOR_LIGHTRED,string);
					format(string, sizeof(string), "[iNFO] %s a été envoyé en prison par Administrateur [Raison: %s]", giveplayer, (result));
					printf("%s",string);
				}
			}
		}
		else
		{
			SendClientMessage(playerid, COLOR_GRAD1, "Vous n'etes pas autoriser a faire ceci");
		}
	}
	return 1;
}
 
Link to comment
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Script Non Explicatif

 if(strcmp(cmd, "/taule", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
           tmp = strtok(cmdtext, idx);
           if(!strlen(tmp))
           {
               SendClientMessage(playerid, COLOR_GRAD2, "[CMD]: /taule [iD] [temps(minutes] [raison]");
               return 1;
           }
           new playa;
           new money;
           playa = ReturnUser(tmp);
           tmp = strtok(cmdtext, idx);
           money = strval(tmp);
           if (PlayerInfo[playerid][pAdmin] >= 1000) // Level Admin 
           {
               if(IsPlayerConnected(playa))
               {
                   if(playa != INVALID_PLAYER_ID)
                   {
                       GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                       GetPlayerName(playerid, sendername, sizeof(sendername));
                       new length = strlen(cmdtext);
                       while ((idx < length) && (cmdtext[idx] <= ' '))
                       {
                           idx++;
                       }
                       new offset = idx;
                       new result[82];
                       while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                       {
                           result[idx - offset] = cmdtext[idx];
                           idx++;
                       }
                       result[idx - offset] = EOS;
                       if(!strlen(result))
                       {
                           SendClientMessage(playerid, COLOR_GRAD2, "[CMD]: /taule [iD] [temps(minutes)] [Raison]");
                           return 1;
                       }
                       format(string, sizeof(string), "* Vous mettez en prison %s.", giveplayer);
                       SendClientMessage(playerid, COLOR_LIGHTRED, string);
                       format(string, sizeof(string), "* Vous êtes envoyé en prison par Administrateur.", sendername);
                       SendClientMessage(playa, COLOR_LIGHTRED, string);
                       SafeResetPlayerWeapons(playa);
                       WantedPoints[playa] = 0;
                       PlayerInfo[playa][pJailed] = 1;
                       PlayerInfo[playa][pJailTime] = money*60;
                       SetPlayerInterior(playa, 0);
                       PlayerInfo[playa][pInt] = 0;
                       SetPlayerVirtualWorld (playa, 1);
                       SetPlayerPos(playa, 1764.8106,-1542.6401,9.3901); // Position ou le Joueur Sera Teleporter 
                       SetPlayerSkin(playa, 268); // Le skin que le joueur aura une fois en taule 
                       format(string, sizeof(string), "Vous êtes en prison pendant %d minutes. Bail: Indiscutable", money);
                       SendClientMessage(playa, COLOR_WHITE, string);
                       SendClientMessage(playa, COLOR_WHITE, "Gardien: Voici ta tenue de prisonnier,Bon sejour! **rigole");
                       format(string, 256, "[iNFO] %s a été emprisonné par Administrateur [Raison: %s]", giveplayer, (result));
                       BroadCast(COLOR_LIGHTRED,string);
                       format(string, sizeof(string), "[iNFO] %s a été envoyé en prison par Administrateur [Raison: %s]", giveplayer, (result));
                       printf("%s",string);
                   }
               }
           }
           else
           {
               SendClientMessage(playerid, COLOR_GRAD1, "Vous n'etes pas autoriser a faire ceci");
           }
       }
       return 1;
   }

 

Voila Refait Avec quelque Explication dans le codage pour les Nouveaux scripteur

Link to comment
  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Flux d'Activité

    1. 29

      Rodnia.net | PVM | International | The Great Conqueror |

    2. 0

      [Funding/Incubator Program] W Combinator

    3. 25

      File Bvural41 (PAYANT) lvl 1-120 - Multi-Language

    4. 25

      File Bvural41 (PAYANT) lvl 1-120 - Multi-Language

    5. 9

      Canal général

    6. 9

      Canal général

    7. 9

      Canal général

    8. 9

      Canal général

    9. 9

      Canal général

  • Recently Browsing

    No registered users viewing this page.

Important Information

Terms of Use / Privacy Policy / Guidelines / 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.