Jump to content

Recommended Posts

Posted

}
YCMD:cumparabilet(playerid, params[], help) {
    if(PlayerMoney(playerid, 5000000)) return SCM(playerid, -1, "Nu ai aceasta suma de bani!");
    if(!IsPlayerInRangeOfPoint(playerid, 5, 1314.5472,1521.7521,1514.2909)) return SCM(playerid, COLOR_ERROR, "Nu poti cumpara un bilet deoarece nu esti la casa de bilete!");
    GivePlayerCash(playerid, 0, 5000000);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    SCM(playerid, COLOR_SERVER, "(PARTY2023): Felicitari!Tocmai ti-ai cumparat un {FF0000}bilet {ffffff}pentru suma de {FF0000}$5.000.000 {ffffff}la cel mai super blana {FF0000}PARTY");
    PlayerInfo[playerid][pBilet]++;
    return true;

cum pot sa ii adaug gen sa poata un jucator sa cumpere 2 bilete maxim sau unul?

Posted

Salut!

1 - La inceput, faci o verificare daca jucatorul are 1 sau mai multe bilete

if(PlayerInfo[playerid][pBilet] < 3)) return SendClientMessage(playerid, -1, "Ai deja 2 bilete)

2 - La verificare putem adauga si asa ceva ( if(PlayerInfo[playerid][pBilet] == 0)) { sursa codului }  

 

Posted
2 hours ago, Serban said:

Salut!

1 - La inceput, faci o verificare daca jucatorul are 1 sau mai multe bilete

if(PlayerInfo[playerid][pBilet] < 3)) return SendClientMessage(playerid, -1, "Ai deja 2 bilete)

2 - La verificare putem adauga si asa ceva ( if(PlayerInfo[playerid][pBilet] == 0)) { sursa codului }  

 

no, acolo tu verifici daca valoarea e mai mica de 3, trebuie sa verifici daca valoarea este 2 sau pentru siguranta daca valoarea este mai mare sau egal cu 2, adica '>= 2'.

  • Thanks 1
Posted

Ai dreptate.

6 hours ago, Sancky said:

no, acolo tu verifici daca valoarea e mai mica de 3, trebuie sa verifici daca valoarea este 2 sau pentru siguranta daca valoarea este mai mare sau egal cu 2, adica '>= 2'.

 

  • 3 months later...
Posted (edited)

YCMD:cumparabilet(playerid, params[], help) {

    if(PlayerInfo[playerid][pBilet] >= 2)) return SendClientMessage(playerid, -1, "Ai deja 2 bilete);

    if(PlayerMoney(playerid, 5000000)) return SCM(playerid, -1, "Nu ai aceasta suma de bani!");

    if(!IsPlayerInRangeOfPoint(playerid, 5, 1314.5472,1521.7521,1514.2909)) return SCM(playerid, COLOR_ERROR, "Nu poti cumpara un bilet deoarece nu esti la casa de bilete!");

    GivePlayerCash(playerid, 0, 5000000);

    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

    SCM(playerid, COLOR_SERVER, "(PARTY2023): Felicitari!Tocmai ti-ai cumparat un {FF0000}bilet {ffffff}pentru suma de {FF0000}$5.000.000 {ffffff}la cel mai super blana {FF0000}PARTY");

    PlayerInfo[playerid][pBilet]++;

    return true;

}

Edited by Hackeru Suprem
Comanda

Join the conversation

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

Guest
Reply to this topic...

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

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