Jump to content
  • 0

pomoc [HELp]Marihuana


Palso

Dotaz

Ahoj, potrebujem poradit ako urobit nieco podobne ako je na RZe s tou marihuanou ... ja nepotrebujem zaidne ze sklidit a pod. potrebujem nieco take ze ked hrač zada nrp. /kupitmarihuanu tak mu to za dajmetomu 500$ kupi 5g marihuany. a potom ked da /prodatmarihuanu [iD] [Gramy] tak to preda danemu hracovi a ze ked nebdue mat tolko gramov tak napise Nemas dostatok marihuany ... prosim pomozte ja fakt neviem kao nato :d :D Za kazdu pomoc dakujem :boss::rofl:

Link to comment
Share on other sites

6 odpovědí na tuto otázku

Recommended Posts

  • 0

niekde hore ku include

 

new marihuana[MAXPLAYERS];

 

public OnPlayerCommandText(playerid, cmdtext[])

{

dcmd(prodatmarihuanu,20,cmdtext);

return 1;

}

niekde za publici najlepšie ked už máš nejaké aby si to dal k nim :)

////////////////////////////////////////////////////////////////////////////////

dcmd_prodatmarihuanu(playerid, params[])

{

new ID,GRAMY,CENA;

if(sscanf(params, "iii", ID,GRAMY))

return SendClientMessage(playerid,COLOR_WHITE,"[ ! ] /prodatmarihuanu [iD] [GRAMY] [CENA]");

new id=strval(params);

if(!IsPlayerConnected(id))

return SendClientMessage(playerid,COLOR_WHITE,"[ ! ] Tento hráč nie je na servery");

if(marihuana[playerid] > GRAMY)

{

marihuana[id] +GRAMY;

GivePlayerMoney(playerid, CENA);

GivePlayerMoney(id, -CENA);

 

new hrac1[MAX_PLAYER_NAME];

new hrac2[MAX_PLAYER_NAME];

new sprava[128];

 

GetPlayerName(playerid,hrac1,MAX_PLAYER_NAME);

GetPlayerName(id,hmeno1,MAX_PLAYER_NAME);

format(sprava, sizeof(sprava), "Hráč %s predal hráčovy %s marihuanu za %s", hrac1, hrac2,CENA);

SendClientMessageToAll( TU_DAJ_FARBU , sprava1);

}

else

{

SendClientMessage(playerid,COLOR_RED,"[ ! ] Nemáš toľko marihuany");

}

return 1;

}

////////////////////////////////////////////////////////////////////////////////

neviem či to je dobre pisal som to teraz :)

Su tam iste chyby tak nech ti to opravia :d :D pisal som to nakolene

Link to comment
Share on other sites

  • 0

NEviem co s tym :d

warning 217: loose indentation
C:\Users\Doma\Desktop\test.pwn(107) : error 017: undefined symbol "sscanf"
C:\Users\Doma\Desktop\test.pwn(114) : warning 215: expression has no effect
C:\Users\Doma\Desktop\test.pwn(123) : error 017: undefined symbol "hmeno1"
C:\Users\Doma\Desktop\test.pwn(125) : error 017: undefined symbol "sprava1"
C:\Users\Doma\Desktop\test.pwn(106) : warning 203: symbol is never used: "ID"
C:\Users\Doma\Desktop\test.pwn(106 -- 133) : error 010: invalid function or declaration

Link to comment
Share on other sites

  • 0

 

1. if(sscanf(params, "iii", ID,GRAMY,CENA))

2. marihuana[id] +GRAMY;

3. GetPlayerName(id,hmeno1,MAX_PLAYER_NAME);

4. SendClientMessageToAll( COLOR_GREEN, sprava1);

5. new ID,GRAMY,CENA;

:hallo:

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...