Jump to content

Question

Posted

Problema intalnita (descriere): Vreau sa fac o comanda , mai exact "/dmv" la care sa te teleporteze la DMV. Doar daca nu ai licenta si teleportarea costa 10k
Ero(area / rile) / warning-(ul / urile): Pai nici macar nu ma lasa sa compilez , imi da eroare la pawn
Liniile de cod / sursa / script-ul(obligatoriu): 

	if(strcmp(cmd, "/dmv", true) == 0)
 	{
 		if (PlayerToPoint(0.8, playerid,246.4011, 118.7430, 1003.2187))
		{
  		if(PlayerInfo[playerid][pCash] >= -10000)
        {
        	if(PlayerInfo[playerid][pCarLic] == 0)
         	{
          		if(DMVPrepare[playerid] == 0)
            	{
			            SetPlayerPos(playerid, -2311.7415,-1637.7587,483.2643);
			            SetPlayerInterior(playerid, 3);
 				}
	            else
	            {
                    SendClientMessage(playerid,COLOR_GREY,"Nu esti la locul teleportarii!");
           	 	}
      		}
        	else
         	{
          			SendClientMessage(playerid,COLOR_GREY,"Deja ai licenta de sofer!" );
          	}
      	}
      	else
      	{
	                SendClientMessage(playerid,COLOR_GREY,"Nu ai bani pentru a te teleporta!");
      	}
	}
		}

Imagini / Video (optional):
Ati incercat sa rezolvati singur?: Da.

 

Mai exact nu cred ca sunt bine aranjate scripturile :-? de nu ma lasa sa compilez ... Dar cand sterg comanda se compileaza fara nici-o eroare

9 answers to this question

Recommended Posts

  • 0
Posted

Salut, asta te ajuta?

if(strcmp(cmd, "/dmv", true) == 0)
     {
         if (PlayerToPoint(0.8, playerid,246.4011, 118.7430, 1003.2187))
        {
              if(PlayerInfo[playerid][pCash] > 10000)
            {
                if(PlayerInfo[playerid][pCarLic] == 0)
                 {
                      if(DMVPrepare[playerid] == 0)
                    {
                        SetPlayerPos(playerid, -2311.7415,-1637.7587,483.2643);
                        SetPlayerInterior(playerid, 3);
                       }
                    else
                    {
                        SendClientMessage(playerid,COLOR_GREY,"Nu esti la locul teleportarii!");
                        }
                  }
                else
                 {
                      SendClientMessage(playerid,COLOR_GREY,"Deja ai licenta de sofer!" );
                  }
               }
          }
          else
          {
            SendClientMessage(playerid,COLOR_GREY,"Nu ai bani pentru a te teleporta!");
          }
          return 1;
    }

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
  • 0
Posted

:mellow:   incearca asa

if(strcmp(cmd, "/dmv", true) == 0)
   {
     if (PlayerToPoint(0.8, playerid,246.4011, 118.7430, 1003.2187))
    {
       if(GetPlayerMoney(playerid) > 10000)
        {
          if(PlayerInfo[playerid][pCarLic] == 0)
           {
              if(DMVPrepare[playerid] == 0)
              {
              SetPlayerPos(playerid, -2311.7415,-1637.7587,483.2643);
                SetPlayerInterior(playerid, 3);
               }
              else
              {
                    SendClientMessage(playerid,COLOR_GREY,"Nu esti la locul teleportarii!");
              }
          }
          else
           {
              SendClientMessage(playerid,COLOR_GREY,"Deja ai licenta de sofer!" );
            }
         }
      }
      else
      {
       SendClientMessage(playerid,COLOR_GREY,"Nu ai bani pentru a te teleporta!");
      }
      return 1;
  }      

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
  • 0
Posted

Incearca asa :

if(strcmp(cmd, "/dmv", true) == 0)
   {
     if (PlayerToPoint(0.8, playerid,246.4011, 118.7430, 1003.2187))
    {
    if(PlayerInfo[playerid][pCash] <= 10000)
      {
          if(PlayerInfo[playerid][pCarLic] == 0)
           {
              if(DMVPrepare[playerid] == 0)
              {
               SetPlayerPos(playerid, -2311.7415,-1637.7587,483.2643);
                SetPlayerInterior(playerid, 3);
				PlayerInfo[playerid][pCash] -= 10000;
               }
              else
              {
                    SendClientMessage(playerid,COLOR_GREY,"Nu esti la locul teleportarii!");
              }
          }
          else
           {
              SendClientMessage(playerid,COLOR_GREY,"Deja ai licenta de sofer!" );
            }
         }
      }
      else
      {
     SendClientMessage(playerid,COLOR_GREY,"Nu ai bani pentru a te teleporta!");
      }
      return 1;
  }
  • 0
Posted

if(GetPlayerMoney(playerid) < 10000) // Sa verifice daca are mai mic sau la fel cu $10k

return SendClientMessage(playerid,-1,"Trebuie sa ai cel putin $10.000 pentru a te teleporta");

 

GivePlayerMoney(playerid,-10000); // Sa ii scada 10k

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

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.