Jump to content
  • 0

Problema /dmv


ARTFollow.

Question

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

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

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
Link to comment
Share on other sites

  • 0

: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
Link to comment
Share on other sites

  • 0

Cum ai pus tu mai sus inseamna daca playerul are bani pe minus 1000

Ca sa iti ia bani din mana pui acolo la setplayerpos playerdata [playerid][pcash] -= 1000;

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0

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;
  }
Link to comment
Share on other sites

  • 0

Mafia.

if(PlayerInfo[playerid][pCash] >= 10000)

Tu ai pus

if(PlayerInfo[playerid][pCash] <= 10000)
Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0

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;
}

 

Link to comment
Share on other sites

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.