Jump to content

[REZOLVAT] Intrebare - Job pe Y


Ionut09
 Share

Recommended Posts

  • Username : Ionut09
  • Problema întâlnită: Cum pot face job-ul pe Y ? Am gasit ceva, dar vreau sa ies si din job pe tasta y.
  • Detalii despre problemă: -
  • Ce ai încercat să faci înainte să postezi?: -
  • Cod sursa (recomandat pastebin.com) : ce am gasit  + /getjob + quitjob: https://pastebin.com/t9VrmSmv
  • Alte detalii : -
 
Edited by Krusher
// next warn
Link to comment
Share on other sites

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if(newkeys & KEY_YES)
  {
    if(IsPlayerInRangeOfPoint(playerid, ...) // coord jobului tau
    {
      if(PlayerInfo[playerid][pJob] == idul_jobului)
      {
         // ii iei jobul
      }
	  else
	  {
         // codul prin care ii dai jobul respectiv.
	  }
    }
    else if(IsPlayerInRangeOfPoint(playerid, ...) // coord altui job
    {
      // acelasi lucru
    }
  }
}

 

Edited by iMatt

Respecta si vei fi respectat.

 

BigInt Pawn:

Pacman C++: 

Snake C++:

Minesweeper C++:

 

mattbb.cash

leaks.ro

Link to comment
Share on other sites

15 hours ago, iMatt said:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if(newkeys & KEY_YES)
  {
    if(IsPlayerInRangeOfPoint(playerid, ...) // coord jobului tau
    {
      if(PlayerInfo[playerid][pJob] == idul_jobului)
      {
         // ii iei jobul
      }
	  else
	  {
         // codul prin care ii dai jobul respectiv.
	  }
    }
    else if(IsPlayerInRangeOfPoint(playerid, ...) // coord altui job
    {
      // acelasi lucru
    }
  }
}

 

Nu am inteles. Poti face un exemplu ?

Link to comment
Share on other sites

Acum 1 minut, Ionut09 a spus:

Nu am inteles. Poti face un exemplu ?

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) // verificam daca a apasat un key
{
  if(newkeys & KEY_YES) // verificam daca a apasat Y
  {
    if(IsPlayerInRangeOfPoint(playerid, 2.0,0.0,0.0,0.0) // avem job-ul cu ID 1 la coordonatele 0.0, 0.0, 0.0
    {
      if(PlayerInfo[playerid][pJob] != 0) // verificam daca are vreun job
      {
        PlayerInfo[playerid][pJob] = 0;
		SCM(playerid, -1, "Ai demisionat de la job-ul tau actual.");
      }
	  else // daca nu are niciun job
	  {
        PlayerInfo[playerid][pJob] = 1;
		SCM(playerid, -1, "Te-ai angajat la job-ul cu ID 1.");
	  }
    }
    else if(IsPlayerInRangeOfPoint(playerid, 2.0, 100.0, 100.0, 100.0) // coord altui job
    {
      // acelasi lucru
    }
  }
}

 

Respecta si vei fi respectat.

 

BigInt Pawn:

Pacman C++: 

Snake C++:

Minesweeper C++:

 

mattbb.cash

leaks.ro

Link to comment
Share on other sites

3 hours ago, iMatt said:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) // verificam daca a apasat un key
{
  if(newkeys & KEY_YES) // verificam daca a apasat Y
  {
    if(IsPlayerInRangeOfPoint(playerid, 2.0,0.0,0.0,0.0) // avem job-ul cu ID 1 la coordonatele 0.0, 0.0, 0.0
    {
      if(PlayerInfo[playerid][pJob] != 0) // verificam daca are vreun job
      {
        PlayerInfo[playerid][pJob] = 0;
		SCM(playerid, -1, "Ai demisionat de la job-ul tau actual.");
      }
	  else // daca nu are niciun job
	  {
        PlayerInfo[playerid][pJob] = 1;
		SCM(playerid, -1, "Te-ai angajat la job-ul cu ID 1.");
	  }
    }
    else if(IsPlayerInRangeOfPoint(playerid, 2.0, 100.0, 100.0, 100.0) // coord altui job
    {
      // acelasi lucru
    }
  }
}

 

Rezolvat, mersi frumos.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...