Jump to content
  • 0

Un ajutor la comanda!!


heker

Question

Salut am si eu comanda:

if(strcmp(cmd, "/fmats", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(IsAMember(playerid))
	        {
	        	new x;
				x = PlayerInfo[playerid][pMember] + PlayerInfo[playerid][pLeader];
	            if(PlayerInfo[playerid][pRank] < 3)
	            {
	                SCM(playerid, COLOR_GREY, "   You need to be Rank 3 or Higher for this action !");
	                return 1;
	            }
	            /*if(DynamicFactions[x][fSafe] <= 0)
				{
					SCM(playerid, COLOR_WHITE, "The leader must buy a SAFE first !");
					return 1;
				}*/
	            new x_nr[256];
				x_nr = strtok(cmdtext, idx);
				if(!strlen(x_nr))
				{
					if(PTP(5.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ]))
					{
						format(string, sizeof(string), "Faction Mats: $%d.", DynamicFactions[x][fMats]);
						SCM(playerid, COLOR_WHITE, string);
					}
					SCM(playerid, COLOR_WHITE, "|________________________fMats_________________________|");
					SCM(playerid, COLOR_WHITE, "| USAGE: /fmats [name] [ammount]");
			  		SCM(playerid, COLOR_GREY, " | Available names: Take , Put");
					SCM(playerid, COLOR_WHITE, "|______________________________________________________|");
					return 1;
				}
				GetPlayerName(playerid, sendername, sizeof(sendername));
				GetPlayerName(giveplayerid, playername, sizeof(playername));
			    if(strcmp(x_nr,"take",true) == 0)
				{
					tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SCM(playerid, COLOR_GREY, "[USAGE:] /fmats take [amount]");
						return 1;
					}
					new materialsdeposit = strval(tmp);
					if(!strlen(tmp))
					{
						SCM(playerid, COLOR_GREY, "[USAGE:] /fmats take [amount]");
						return 1;
					}
					if(PTP(5.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ]))
					{
					    if(materialsdeposit <=DynamicFactions[x][fMats])
					    {
							PlayerInfo[playerid][pMats] += materialsdeposit;
							DynamicFactions[x][fMats]=DynamicFactions[x][fMats]-materialsdeposit;
							format(string, sizeof(string), "You have taken %d mats from the storage facility, Materials Total: %d ", materialsdeposit,DynamicFactions[x][fMats]);
							SCM(playerid, COLOR_LIGHTBLUE, string);
							format(string, sizeof(string),  "%s has just taken %d mats from the faction storage facility.",sendername,materialsdeposit);
							SendFamilyMessage(x, TEAM_AZTECAS_COLOR, string);
							SaveDynamicFactions();
							return 1;
						}
			 			else
						{
							SCM(playerid, COLOR_GREY, "There isn't that much mats in storage!");
						}
					}
					else
					{
						SCM(playerid, COLOR_GREY	, "You are not at the faction storage facility!");
					}
				}
    			else if(strcmp(x_nr,"put",true) == 0)
				{
					tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SCM(playerid, COLOR_GREY, "[USAGE:] /fmats put [amount]");
						return 1;
					}
					new materialsdeposit = strval(tmp);
					if(!strlen(tmp))
					{
						SCM(playerid, COLOR_GREY, "[USAGE:] /fmats put [amount]");
						return 1;
					}
					if(PTP(5.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ]))
					{
					    if(materialsdeposit <= PlayerInfo[playerid][pMats])
					    {
							PlayerInfo[playerid][pMats] =PlayerInfo[playerid][pMats]-materialsdeposit;
							DynamicFactions[x][fMats] +=materialsdeposit;
							format(string, sizeof(string), "You putted %d mats from the storage facility, Materials Total: %d ", materialsdeposit,DynamicFactions[x][fMats]);
							SCM(playerid, COLOR_LIGHTBLUE, string);
							format(string, sizeof(string),  "%s has just putted %d mats from the faction storage facility.",sendername,materialsdeposit);
							SendFamilyMessage(x, TEAM_AZTECAS_COLOR, string);
							SaveDynamicFactions();
							return 1;
						}
			 			else
						{
							SCM(playerid, COLOR_GREY, "You don't have that much mats on you!");
						}
					}
					else
					{
						SCM(playerid, COLOR_GREY, "You are not at the faction storage facility!");
					}
				}
				else
				{
					SCM(playerid, COLOR_GREY, "Unknown fMats name !");
					return 1;
				}
	        }
	        else
	        {
	            SCM(playerid, COLOR_GREY, "You are not a gang member !");
	            return 1;
	        }
	    }
	    return 1;
	}

si merge de peste tot :| eu vreau decat dintrun loc sa merga si doar o anumita factiune sa o folosesca :D ma ajutati va rog, am mai multe comenzi dar datimi un exeplu daca se poate :D

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

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.