Jump to content

Property (cez menu+pickup)


Guest TriskacSK

Recommended Posts

Guest TriskacSK

Dlhsie som rozmyslal aky TUT by som mohol spravit a rozhodol som sa, ze spravim TUT na property... Takze:

 

Hore do kodu :

 

new vlastnik[MAX_PLAYERS];
new kup;
new Menu:kupmenu;

OnGameModeInit:

 

kup = CreatePickup(1318,1,-1957.9437,297.6426,35.4688); // pozicia kde bude pickup
kupmenu = CreateMenu("Wang", 1, 50.0, 180.0, 280.0, 200.0);
AddMenuItem(kupmenu, 0, "Kupit");
AddMenuItem(kupmenu, 0, "Koniec");

 

OnPlayerPickUpPickup:

 

if(pickupid == kup)
{
ShowMenuForPlayer(kupmenu,playerid); // ak stupi na pickup zobrazi sa mu menu
}

 

OnPlayerSelectedMenuRow:

 

 

new Menu:Current = GetPlayerMenu(playerid);
new pname[MAX_PLAYER_NAME];
new string[256];

//Funkcia co sa stane:
new Menu:Current = GetPlayerMenu(playerid);
new pname[MAX_PLAYER_NAME];
new string[256];

//Funkcia co sa stane:

if (Current == kupmenu) {
switch(row) {
case 0:{
if(vlastnik[playerid] == 0) //Ak nie je vlastník
{
if(GetPlayerMoney(playerid) >= 50000)
{
GivePlayerMoney(playerid,-50000);
for(new i=0; i{
if(IsPlayerConnected(i) && vlastnik[i]==1)
{
vlastnik[i]=0;
}
}
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "Hráč %s sa stal vlastníkom Wangu.", pname);
SendClientMessageToAll(Farba_XXX, string);
vlastnik[playerid] = 1;
        }else{
SendClientMessage(playerid,Farba_XXX," Nemáš 50000.");
     }
   }else{
SendClientMessage(playerid,Farba_XXX,"Už vlastníš tuto budovu.");
}
}
}

Dufam, ze sa vam TUT paci a tesim sa na dalsiu spolupracu. 8-)

 

195.70.150.39-7777.png

____________________________

IP:195.70.150.39:7777

Link to comment
Share on other sites

Guest TriskacSK

a co mas potom z toho tak rovno si stiahni neaky mod nahod si na server a bud happy :rap: :rap: ... Ak uz zacnem s pawnom tak sa ho chcem naucit ....

 

195.70.150.39-7777.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...