Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×

Question

Posted

Am facut o comanda zilele astea si am o intrebare

//----------------------------[depune]-------------------------------------------------//
	if(strcmp(cmd,"/depune",true)==0)
    {
        if(IsPlayerConnected(playerid))
	    {
            if(PlayerToPoint(25.0,playerid,653.7766,-496.4872,16.3359))
            {
			   new x_nr[256];
			   x_nr = strtok(cmdtext, idx);
			   if(!strlen(x_nr)) {
			      SendClientMessage(playerid, COLOR_WHITE, "|__________________ Depune __________________|");
				  SendClientMessage(playerid, COLOR_WHITE, "USAGE: /depune [name]");
				  SendClientMessage(playerid, COLOR_GREY, "Available names: mats, drugs");
				  SendClientMessage(playerid, COLOR_WHITE, "|____________________________________________|");
				  return 1;
			   }
	           if(strcmp(x_nr,"mats",true) == 0)
			   {
			      tmp = strtok(cmdtext, idx);
			      if(!strlen(tmp))
			      {
				     SendClientMessage(playerid, COLOR_GRAD2, "USAGE: Mats [amount]");
				     format(string, sizeof(string), "  You Have %d Mats on you.", PlayerInfo[playerid][pMats]);
				     SendClientMessage(playerid, COLOR_GRAD3, string);
				     return 1;
			      }
                  new matss;
                  matss = strval(tmp);
                  if(!strlen(tmp))
			      {
				     SendClientMessage(playerid, COLOR_GRAD2, "USAGE: Mats [amount]");
				     format(string, sizeof(string), "  You Have %d Mats on you.", PlayerInfo[playerid][pMats]);
				     SendClientMessage(playerid, COLOR_GRAD3, string);
				     return 1;
			      }
                  if(matss > PlayerInfo[playerid][pMats])
                  {
                     SendClientMessage(playerid, COLOR_GRAD2, "   You don't have that many!");
                     return 1;
                  }
                  PlayerInfo[playerid][pMats] -= matss;
                  PlayerInfo[playerid][pBoxMats] += matss;
                  format(string, sizeof(string), "   %d materials deposited!", matss);
                  SendClientMessage(playerid, COLOR_GRAD4, string);
                  return 1;
			   }
			   else if(strcmp(x_nr,"drugs",true) == 0)
		 	   {
                  tmp = strtok(cmdtext, idx);
			      if(!strlen(tmp))
			      {
				     SendClientMessage(playerid, COLOR_GRAD2, "USAGE: Drugs [amount]");
				     format(string, sizeof(string), "  You Have %d Drugs on you.", PlayerInfo[playerid][pDrugs]);
				     SendClientMessage(playerid, COLOR_GRAD3, string);
				     return 1;
			      }
                  new drugss;
                  drugss = strval(tmp);
                  if(!strlen(tmp))
			      {
				     SendClientMessage(playerid, COLOR_GRAD2, "USAGE: Drugs [amount]");
				     format(string, sizeof(string), "  You Have %d Drugs on you.", PlayerInfo[playerid][pDrugs]);
				     SendClientMessage(playerid, COLOR_GRAD3, string);
				     return 1;
			      }
                  if(drugss > PlayerInfo[playerid][pDrugs])
                  {
                     SendClientMessage(playerid, COLOR_GRAD2, "   You don't have that many!");
                     return 1;
                  }
                  PlayerInfo[playerid][pDrugs] -= drugss;
                  PlayerInfo[playerid][pBoxDrugs] += drugss;
                  format(string, sizeof(string), "   %d Drugs deposited!", drugss);
                  SendClientMessage(playerid, COLOR_GRAD4, string);
                  return 1;
               }
            }
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "   You are not in the safebox place !");
	            return 1;
 			}
        }//not connected
		return 1;
	}

Cum o pot face sa paote fi folosita in mai multe locuri si cum pot face sa o foloseasca doar membri unei anuminte factiuni.

3 answers to this question

Recommended Posts

Posted

1. Pui la if(PlayerToPoint(25.0,playerid,653.7766,-496.4872,16.3359))

if(PlayerToPoint(25.0,playerid,653.7766,-496.4872,16.3359) || PlayerToPoint(25.0,playerid,x,y,z) || PlayerToPoint(25.0,playerid,x,y,z))
2. Adaugi linia asta
if(PlayerInfo[playerid][pMember] == X || PlayerInfo[playerid][pLearer] == X || PlayerInfo[playerid][pMember] == X || PlayerInfo[playerid][pLearer] == X)

i0418xcttya707ofg.jpg

Guest
This topic is now closed to further replies.
×
×
  • 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.