Jump to content
  • 0

Question

Posted

Salut , am un sistem car ownership cu cars.cfg care permite sa ai doar o masina , si as vrea sa poti avea 2 , o masina si un motor.

La /setstat am deja CarKey2 , dar vreau sa fac sa poti avea de adevaratelea , nu sa fie  doar aiurea /setstat . Uitati :

Aici e sestat [pawn]case 22:

{

    PlayerInfo[giveplayerid][pPcarkey2] = amount;

    format(string, sizeof(string), "  The Player VehKey2 Set To %d", amount);

    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

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

    format(string, 256, "AdmWarning: %s a setat cheia2 lui %s la %d.", sendername,giveplayer,amount);

ABroadCast(COLOR_YELLOW,string,1);

StatLog(string);

} [/pawn]

Aici e /v buy , nu te lasa sa cumperi 2 :

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

        {

            if(IsAnOwnableCar(idcar))

            {

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

    {

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

                    return 1;

    }

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

    else { SendClientMessage(playerid, COLOR_GREY, "  You already own a vehicles"); return 1; }

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

{

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

    return 1;

}

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

{

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

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

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

    else { return 1; }

CarInfo[idcar][cOwned] = 1;

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

            format(string, 256, "AdmWarning: %s a cumparat masina id %d.",sendername,GetPlayerVehicleID(playerid));

CumparareLog(string);

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

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

PlayerPlayMusic(playerid);

GameTextForPlayer(playerid, "~w~Congratulations~n~Don't forget to /v park it!", 5000, 3);

SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!");

SendClientMessage(playerid, COLOR_GRAD2, "Type /carhelp to view the vehicle manual!");

DateProp(playerid);

OnPropUpdate();

OnPlayerUpdateEx(playerid);

TogglePlayerControllable(playerid, 1);

return 1;

}

else

{

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

    return 1;

}

            }

        }

        else

        {

            SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]");

            SendClientMessage(playerid, COLOR_WHITE, "Available names: park, lock, sell, color, tow, locate");

            return 1;

        }

    }

    return 1;

}[/pawn]

5 answers to this question

Recommended Posts

Posted

Cauta in gm tau 

[pPcarkey1]
Si dedesupt pui [pPcarkey2] peste tot Si la comanda /v buy Mai pune o cheie :
if(PlayerInfo[playerid][pPcarkey1] == 999) { }
			    	else if(PlayerInfo[playerid][pPcarkey2] == 999) { }

gXvsYS
Posted

Pai cauti

IsAnOwnableCar
Si faci
IsAnOwnableMoto
Dupaia pui
public IsAnOwnableMoto(vehicleid)
{
	if(vehicleid >= de la id && vehicleid <= pana la id) { return 1; }
	return 0;
}

Ca sa stie care sunt motoarele..

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