Jump to content
  • 0

[GF/RP] System Car Personal


mitza505

Question

deci cand ma duc sa dau /v buy imi zice ca am deja 3 masini (neavand nici o masina[pawn] else if(strcmp(x_nr,"buy",true) == 0)

        {

            if(IsAnOwnableCar(idcar))

            {

    if(PlayerInfo[playerid][pPcarkey] != -1 && PlayerInfo[playerid][pPcarkey2]  != -1 &&

PlayerInfo[playerid][pPcarkey3] != -1)

{

    SendClientMessage(playerid, COLOR_GREY, " Ai deja 3 masini!!");

    return 1;

}

if(CarInfo[idcar][cOwned]==1)

{

    SendClientMessage(playerid, COLOR_GREY, "Someone already owns this car");

    return 1;

}

if(GetPlayerMoney(playerid) >= CarInfo[idcar][cValue])

{

    if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = idcar; }

    else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = idcar; }

    else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = idcar; }

    else { return 1; }

CarInfo[idcar][cOwned] = 1;

GetPlayerName(playerid, sendername, sizeof(sendername));

strmid(CarInfo[idcar][cOwner], sendername, 0, strlen(sendername), 999);

GivePlayerMoney(playerid,-CarInfo[idcar][cValue]);

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

GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);

        SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");

        TogglePlayerControllable(playerid, 1);

OnPropUpdate(); SavePlayerData(playerid);

return 1;

}

else

{

    SendClientMessage(playerid, COLOR_GREY, "  You don't have enough cash with you ! ");

    return 1;

}

            }

        }[/pawn]

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

[pawn]else if(strcmp(x_nr,"buy",true) == 0)

        {

            if(IsAnOwnableCar(idcar))

            {

                if(PlayerInfo[playerid][pLevel] < 2)

    {

                    SendClientMessage(playerid, COLOR_GREY, "You need to be level 2 to buy a vehicle!");

                    return 1;

    }

    if(PlayerInfo[playerid][pPcarkey1] == 999) { }

    else if(PlayerInfo[playerid][pPcarkey2] == 999) { }

    else { SendClientMessage(playerid, COLOR_GREY, "Ai Deja 2 Masini"); return 1; }

if(CarInfo[idcar][cOwned]==1)

{

    SendClientMessage(playerid, COLOR_WHITE, "Cineva mai detine aceasta masina");

    return 1;

}

if(GetPlayerMoney(playerid) >= CarInfo[idcar][cValue])

{

    if(PlayerInfo[playerid][pPcarkey1] == 999) { PlayerInfo[playerid][pPcarkey1] = idcar; }

    else if(PlayerInfo[playerid][pPcarkey2] == 999) { PlayerInfo[playerid][pPcarkey2] = idcar; }

    else { return 1; }

                        CarInfo[idcar][cOwned] = 1;

GetPlayerName(playerid, sendername, sizeof(sendername));

strmid(CarInfo[idcar][cOwner], sendername, 0, strlen(sendername), 999);

GivePlayerMoney(playerid,-CarInfo[idcar][cValue]);

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

GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);

        SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");

        TogglePlayerControllable(playerid, 1);

OnPropUpdate(); SavePlayerData(playerid);

return 1;

}

else

{

    SendClientMessage(playerid, COLOR_GREY, "You don't have enough cash with you ! ");

    return 1;

}

            }

        }[/pawn]

Stiu si eu ... branza e pe bani, dar eu tot ma joc pe gratis!

Link to comment
Share on other sites

Daca aceasta treaba ti se intampla doar tie poti folosi foarte usor comanda [glow=red,2,300]/setstat[/glow]

exp.: la mine pe server am carkey1=21 ; carkey2=22 ; carkey3=23

Folosesc comanda: /setstat danii14 21 999 ; /setstat danii14 22 999 ; /setstat danii14 23 999

Te-am ajutat ? Dami un +1 si suntem chit :) !

Link to comment
Share on other sites

[pawn]C:\Users\Best-Life\Desktop\carownership.pwn(809) : error 017: undefined symbol "pLevel"

C:\Users\Best-Life\Desktop\carownership.pwn(814) : error 017: undefined symbol "pPcarkey1"

C:\Users\Best-Life\Desktop\carownership.pwn(824) : error 017: undefined symbol "pPcarkey1"

C:\Users\Best-Life\Desktop\carownership.pwn(824) : error 017: undefined symbol "pPcarkey1"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

4 Errors.[/pawn]

814

[pawn]if(PlayerInfo[playerid][pPcarkey1] == 999) { }[/pawn]

824

[pawn]     if(PlayerInfo[playerid][pPcarkey1] == 999) { PlayerInfo[playerid][pPcarkey1] = idcar; }[/pawn]

Link to comment
Share on other sites

[pawn]C:\Users\Best-Life\Desktop\carownership.pwn(809) : error 017: undefined symbol "pLevel"

C:\Users\Best-Life\Desktop\carownership.pwn(814) : error 017: undefined symbol "pPcarkey1"

C:\Users\Best-Life\Desktop\carownership.pwn(824) : error 017: undefined symbol "pPcarkey1"

C:\Users\Best-Life\Desktop\carownership.pwn(824) : error 017: undefined symbol "pPcarkey1"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

4 Errors.[/pawn]

814

[pawn]if(PlayerInfo[playerid][pPcarkey1] == 999) { }[/pawn]

824

[pawn]     if(PlayerInfo[playerid][pPcarkey1] == 999) { PlayerInfo[playerid][pPcarkey1] = idcar; }[/pawn]

Tu folosesti comanda intr-un gm sau fs ?

Dupa ce vad eu intr-un fs, deci...

Cauta:

[pawn]if(PlayerInfo[playerid][pLevel] < 2)

    {

                    SendClientMessage(playerid, COLOR_GREY, "You need to be level 2 to buy a vehicle!");

                    return 1;

    }

[/pawn]

Si scoatel.

Schimba pPcarkey1 cu pPcarkey

Stiu si eu ... branza e pe bani, dar eu tot ma joc pe gratis!

Link to comment
Share on other sites

[pawn]C:\Users\Best-Life\Desktop\carownership.pwn(812) : warning 225: unreachable code

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

1 Warning.

[/pawn]

812[pawn] if(CarInfo[idcar][cOwned]==1)[/pawn]

[pawn]  else if(strcmp(x_nr,"buy",true) == 0)

        {

            if(IsAnOwnableCar(idcar))

            {

    if(PlayerInfo[playerid][pPcarkey] == 999) { }

    else if(PlayerInfo[playerid][pPcarkey2] == 999) { }

    else { SendClientMessage(playerid, COLOR_GREY, "Ai Deja 2 Masini"); return 1; }

if(CarInfo[idcar][cOwned]==1)

{

    SendClientMessage(playerid, COLOR_WHITE, "Cineva mai detine aceasta masina");

    return 1;

}

if(GetPlayerMoney(playerid) >= CarInfo[idcar][cValue])

{

    if(PlayerInfo[playerid][pPcarkey] == 999) { PlayerInfo[playerid][pPcarkey] = idcar; }

    else if(PlayerInfo[playerid][pPcarkey2] == 999) { PlayerInfo[playerid][pPcarkey2] = idcar; }

    else { return 1; }

                        CarInfo[idcar][cOwned] = 1;

GetPlayerName(playerid, sendername, sizeof(sendername));

strmid(CarInfo[idcar][cOwner], sendername, 0, strlen(sendername), 999);

GivePlayerMoney(playerid,-CarInfo[idcar][cValue]);

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

GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);

        SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");

        TogglePlayerControllable(playerid, 1);

OnPropUpdate(); SavePlayerData(playerid);

return 1;

}

else

{

    SendClientMessage(playerid, COLOR_GREY, "You don't have enough cash with you ! ");

    return 1;

}

            }

        }[/pawn]

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.