Jump to content
  • 0

Masina Personala


Question

Posted

Nume: Mush

Problem? întâlnit?: Am un sistem de masini personale, cand cumpar masina cu numele meu si schimb numele intru in ea imi apare ca este a altuia dar nu ma da afara ci ma lasa sa o conduc.

Ce am încercat pân? acum: Am pus:

[pawn]new sendername[MAX_PLAYER_NAME];

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

                if(strcmp(sendername,"%s",true, CarInfo[newcar][cOwner]))[/pawn]

si [pawn]RemovePlayerFromVehicle(playerid);[/pawn]

Dar tot degeaba, acuma ma da afara chiar daca masina este a mea.

Codul sursa/Log/Altele:

[pawn]public OnPlayerStateChange(playerid, newstate, oldstate)

{

new string[128];

new vehicle = GetPlayerVehicleID(playerid);

new newcar = GetPlayerVehicleID(playerid);

if(newstate == PLAYER_STATE_DRIVER)

{

if(IsAnOwnableCar(newcar))

{

    if(CarInfo[newcar][cOwned]==0)

    {

        TogglePlayerControllable(playerid, 0);

        format(string,sizeof(string),"%s Price: %d /v buy to buy this vehicle",CarInfo[newcar][cDescription],CarInfo[newcar][cValue]);

        SendClientMessage(playerid, COLOR_BLUE, string);

        SendClientMessage(playerid, COLOR_BLUE, "or press Enter to exit this vehicle");

    }

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

    {

                new sendername[MAX_PLAYER_NAME];

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

                if(strcmp(sendername,"%s",true, CarInfo[newcar][cOwner]))

        format(string,sizeof(string),"Vehicle registered to %s",CarInfo[newcar][cOwner]);

SendClientMessage(playerid, COLOR_BLUE, string);

RemovePlayerFromVehicle(playerid);

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

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

else if(PlayerInfo[playerid][pPcarkey3] == vehicle) { }

else

{

if(IsPlayerAdmin(playerid))

{

    SendClientMessage(playerid, COLOR_GREY, "  You can drive this car because you are admin");

}

                    else

    {

    RemovePlayerFromVehicle(playerid);

    SendClientMessage(playerid, COLOR_GREY, "You don't have a key of this vehicle");

}

}

    }

}

}

return 1;

}[/pawn]

Tot scriptu:  http://www.4shared.com/get/LVsQZeIlce/carownership.html

1 answer to this question

Recommended Posts

Posted

sistemul cumprinde meniul /v ?

Daca da respectivul X care a cuparat-o trebuie sa dea /vlock1 sau /v lock2 sa fie incuiata masina si nu o mai poti lua!

Stiu sistemul e slabut.....

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.