Jump to content
  • 0

Problema comanda Bonus.


Adel

Question

Salut , Am incercat sa bag o comanda de bonus si imi da erori.

Comanda:

 

CMD:bonus(playerid, params [])
{
    if(pInfo[playerid][pScore] > 1) return SendClientMessage(playerid, COLOR_DARKGRAY, "Ai primit deja bonusul de bun venit.");
    pInfo[playerid][pScore] += 1, SetPlayerScore(playerid, pInfo[playerid][pScore]), pInfo[playerid][pPremium] = gtm+(10*86400);
    GiveMoney(playerid, 10000000),pInfo[playerid][pSpinGift] += 2, format(stmsg[playerid], 166, "* Felicitari %s, ai primit cadou 10.000.000$ si Cont Premium valabil 10 zile.", GetName(playerid)),
    SendClientMessage(playerid, COLOR_LIGHTBLUE, stmsg[playerid]);
    switch(random(5))
    {
        case 0:
        {
            pInfo[playerid][aVar][34] = 411;
            for(new r = 0; r < 15; ++r) if(Veh[playerid][r][Owner] != pInfo[playerid][pID]) return strmid(Veh[playerid][r][Class], "Free", 0, strlen("Free"), 16), VehExORM(r, playerid),
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Ai primit vehiculul de tip Infernus, acceseaza-ti vehiculul prin comanda /v. Vehiculul va fi disponibil pana la nivel 5.");
        }
        case 1:
        {
            pInfo[playerid][aVar][34] = 541;
            for(new r = 0; r < 15; ++r) if(Veh[playerid][r][Owner] != pInfo[playerid][pID]) return strmid(Veh[playerid][r][Class], "Free", 0, strlen("Free"), 16), VehExORM(r, playerid),
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Ai primit vehiculul de tip Bullet, acceseaza-ti vehiculul prin comanda /v. Vehiculul va fi disponibil pana la nivel 5.");
        }
        case 2:
        {
            pInfo[playerid][aVar][34] = 560;
            for(new r = 0; r < 15; ++r) if(Veh[playerid][r][Owner] != pInfo[playerid][pID]) return strmid(Veh[playerid][r][Class], "Free", 0, strlen("Free"), 16), VehExORM(r, playerid),
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Ai primit vehiculul de tip Sultan, acceseaza-ti vehiculul prin comanda /v. Vehiculul va fi disponibil pana la nivel 5.");
        }
        case 3:
        {
            pInfo[playerid][aVar][34] = 559;
            for(new r = 0; r < 15; ++r) if(Veh[playerid][r][Owner] != pInfo[playerid][pID]) return strmid(Veh[playerid][r][Class], "Free", 0, strlen("Free"), 16), VehExORM(r, playerid),
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Ai primit vehiculul de tip Jester, acceseaza-ti vehiculul prin comanda /v. Vehiculul va fi disponibil pana la nivel 5.");
        }
        case 4:
        {
            pInfo[playerid][aVar][34] = 415;
            for(new r = 0; r < 15; ++r) if(Veh[playerid][r][Owner] != pInfo[playerid][pID]) return strmid(Veh[playerid][r][Class], "Free", 0, strlen("Free"), 16), VehExORM(r, playerid),
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Ai primit vehiculul de tip Cheetah, acceseaza-ti vehiculul prin comanda /v. Vehiculul va fi disponibil pana la nivel 5.");
        }
    }
    return 1;
}
 

 

erori:

 

D:\Users\mirel\Desktop\gm\gamemodes\bu.pwn(10748) : error 028: invalid subscript (not an array or too many subscripts): "pInfo"
D:\Users\adel\Desktop\gm\gamemodes\bu.pwn(10748) : warning 215: expression has no effect
D:\Users\adel\Desktop\gm\gamemodes\bu.pwn(10748) : error 001: expected token: ";", but found "]"
D:\Users\adel\Desktop\gm\gamemodes\bu.pwn(10748) : error 029: invalid expression, assumed zero
D:\Users\adel\Desktop\gm\gamemodes\bu.pwn(10748) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
La 12.11.2018 la 10:05, Depressive_ a spus:

Arata linia 10748

Salut, Linie 10748 este asta

 

CMD:bonus(playerid, params [])
{
  10748 asta e linia   if(pInfo[playerid][pScore] > 1) return SendClientMessage(playerid, COLOR_DARKGRAY, "Ai primit deja bonusul de bun venit.");
    GiveMoney(playerid, 10000000),pInfo[playerid][pSpinGift] += 2, format(stmsg[playerid], 166, "* Felicitari %s, ai primit cadou 10.000.000$ si Cont Premium valabil 10 zile.", GetName(playerid)),
    SendClientMessage(playerid, COLOR_LIGHTBLUE, stmsg[playerid]);
    switch(random(5))
    {
        case 0:
        {
            pInfo[playerid][aVar][34] = 411;
            for(new r = 0; r < 15; ++r) if(Veh[playerid][r][Owner] != pInfo[playerid][pID]) return strmid(Veh[playerid][r][Class], "Free", 0, strlen("Free"), 16), VehExORM(r, playerid),
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Ai primit vehiculul de tip Infernus, acceseaza-ti vehiculul prin comanda /v. Vehiculul va fi disponibil pana la nivel 5.");
        }
        case 1:
        {
            pInfo[playerid][aVar][34] = 541;
            for(new r = 0; r < 15; ++r) if(Veh[playerid][r][Owner] != pInfo[playerid][pID]) return strmid(Veh[playerid][r][Class], "Free", 0, strlen("Free"), 16), VehExORM(r, playerid),
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Ai primit vehiculul de tip Bullet, acceseaza-ti vehiculul prin comanda /v. Vehiculul va fi disponibil pana la nivel 5.");
        }
        case 2:
        {
            pInfo[playerid][aVar][34] = 560;
            for(new r = 0; r < 15; ++r) if(Veh[playerid][r][Owner] != pInfo[playerid][pID]) return strmid(Veh[playerid][r][Class], "Free", 0, strlen("Free"), 16), VehExORM(r, playerid),
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Ai primit vehiculul de tip Sultan, acceseaza-ti vehiculul prin comanda /v. Vehiculul va fi disponibil pana la nivel 5.");
        }
        case 3:
        {
            pInfo[playerid][aVar][34] = 559;
            for(new r = 0; r < 15; ++r) if(Veh[playerid][r][Owner] != pInfo[playerid][pID]) return strmid(Veh[playerid][r][Class], "Free", 0, strlen("Free"), 16), VehExORM(r, playerid),
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Ai primit vehiculul de tip Jester, acceseaza-ti vehiculul prin comanda /v. Vehiculul va fi disponibil pana la nivel 5.");
        }
        case 4:
        {
            pInfo[playerid][aVar][34] = 415;
            for(new r = 0; r < 15; ++r) if(Veh[playerid][r][Owner] != pInfo[playerid][pID]) return strmid(Veh[playerid][r][Class], "Free", 0, strlen("Free"), 16), VehExORM(r, playerid),
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Ai primit vehiculul de tip Cheetah, acceseaza-ti vehiculul prin comanda /v. Vehiculul va fi disponibil pana la nivel 5.");
        }
    }
    return 1;
}

 

Link to comment
Share on other sites

  • 0
Acum 2 ore, Adel a spus:

<>

Inlocuieste linia 10748 cu

if(PlayerInfo[playerid][pLevel] != 1) return SCM(playerid, -1, "Ai luat deja bonusul de bunvenit");

modifica variabilele cu cele pe care le ai tu in gm

ex: PlayerInfo=pInfo

Edited by Depressive_
un +1 daca te-am ajutat :))
  • Thanks 1
Link to comment
Share on other sites

  • 0
1 oră în urmă, Depressive_ a spus:

Inlocuieste linia 10748 cu

if(PlayerInfo[playerid][pLevel] != 1) return SCM(playerid, -1, "Ai luat deja bonusul de bunvenit");

modifica variabilele cu cele pe care le ai tu in gm

ex: PlayerInfo=pInfo

+1 frt sper sa mă mai ajuti hai prv t/c Rezolvat!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.