Jump to content

Question

Salut,

de curand am inceput un "sistem" de vara.

Cu o comanda ce-ti permite un bonus.

"summerbonus"

Oricum, ceea ce nu inteleg, este ca:

1. Am un tabel in 'users' numit 'SummerBonus' in care daca ai valoarea 1, nu mai poti folosi comanda.

2. Nu am gasit niciun tutorial explicativ cum sa folosesti mysql.

Comanda mea arata pana cum asa:

https://pastebin.com/Lis1tyNM

 

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 1
Acum 2 ore, Alexandru Solomon a spus:

Salut,

de curand am inceput un "sistem" de vara.

Cu o comanda ce-ti permite un bonus.

"summerbonus"

Oricum, ceea ce nu inteleg, este ca:

1. Am un tabel in 'users' numit 'SummerBonus' in care daca ai valoarea 1, nu mai poti folosi comanda.

2. Nu am gasit niciun tutorial explicativ cum sa folosesti mysql.

Comanda mea arata pana cum asa:

https://pastebin.com/Lis1tyNM

 

  • format(string,sizeof(string),"UPDATE `users` SET `SummerBonus` = '1 WHERE `name` = '%s'",PlayerName);
  • mysql_query(string);
if(PlayerInfo[playerid][pSummerBonus] == 1) return SCM(playerid, -1, "Acest bonus poate fii folosit o singura data!"); // aici verifica daca summerbonus este = cu 1. Probabil ca sa interzici vrei sa pui 0. Asa ca pur si simplu inlocuiesti treaba. Pui 0 in loc de 1.
Si in comanda adauga la final:
PlayerInfo[playerid][pSummerBonus] = 0;
Edited by BaFFyJunior

Share this post


Link to post
Share on other sites
  • 0

  

On 2/18/2020 at 5:11 PM, BaFFyJunior said:
  • format(string,sizeof(string),"UPDATE `users` SET `SummerBonus` = '1 WHERE `name` = '%s'",PlayerName);
  • mysql_query(string);
if(PlayerInfo[playerid][pSummerBonus] == 1) return SCM(playerid, -1, "Acest bonus poate fii folosit o singura data!"); // aici verifica daca summerbonus este = cu 1. Probabil ca sa interzici vrei sa pui 0. Asa ca pur si simplu inlocuiesti treaba. Pui 0 in loc de 1.
Si in comanda adauga la final:
PlayerInfo[playerid][pSummerBonus] = 0;

la compilare imi apare eroarea error 035: argument type mismatch (argument 1)

pe linia 

            format(string,sizeof(string),"UPDATE `users` SET `SummerBonus` = '1 WHERE `name` = '%s'",PlayerName);
            mysql_query(string);    <- aici apare eroarea

https://imgur.com/WtOFL40

Share this post


Link to post
Share on other sites
  • -1

Pai si ? nu asta vrei sa se intample ? 

ca atunci cand o folosesti, sa nu mai poata fi folosita a doua oara ?
Si ce fel ai inceput "sistemul" asta daca nu stii ce ai in cod? 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

This site uses cookies. By continuing browsing, you agree to the use of this information. For more details, see Terms of Use and Privacy Policy.