bonus vehicle problem..
#1

pawn Код:
new BonusVehiclePrize,BonusVehicleID;
pawn Код:
CMD:sell(playerid,params)
{
    if(IsPlayerInDynamicCP(playerid,CraneCp))
    {
        if(BonusVehicleID == -1) return SendClientMessage(playerid,RED,"Error: There Is No Bonus Vehicle Today or Someone Already Sold It.");
        printf("DEBUG: Player's Vehiclemodel: %d - BonusVehicleModel: %d;", GetVehicleModel(GetPlayerVehicleID(playerid)), BonusVehicleID);
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) != BonusVehicleID) return SendClientMessage(playerid,RED,"Error: You Are Not In The Bonus Vehicle!");

        new str[128];
        format(str,sizeof(str),"You Have Sold The Bonus Vehicle Today At The Crane For $%d",BonusVehiclePrize);
        SendClientMessage(playerid,TEAL,str);
        format(str,sizeof(str),"Server:%s(%d) Has Sold Today's Bonus Vehicle(%s) At The Crane For $%d!",Playername(playerid),playerid,aVehicleNames[GetVehicleModel(BonusVehicleID)-400],BonusVehiclePrize);
        SendClientMessageToAll(TEAL,str);
        PlayerInfo[playerid][Money]+=BonusVehiclePrize;
        DestroyVehicle(BonusVehicleID);
        BonusVehiclePrize=0;
        BonusVehicleID=-1;
    }
    else
    {
        SendClientMessage(playerid,RED,"You Are Not At The Crane!");
    }
    return 1;
}
here now..
pawn Код:
BonusVehiclePrize = random(125000);
BonusVehicleID = minrand(400,603);
printf("BonusVehicleID = %d",BonusVehicleID);
printf("BonusVehiclePrice = %d",BonusVehiclePrize);
new str[128];
format(str,sizeof(str),"The Bonus Vehicle Today Is The %s, Sell This Vehicle To The Crane For $%d",aVehicleNames[GetVehicleModel(BonusVehicleID)-400],BonusVehiclePrize);
SendClientMessageToAll(TEAL,str);
how to get the id of the aVehicleNames[GetVehicleModel(BonusVehicleID)-400
Reply
#2

In fact its hard to understand what you mean with that.

With this you are getting vehicle name with custom function.
pawn Код:
aVehicleNames[GetVehicleModel(BonusVehicleID)-400]
And you want to get that vehicle ID?

probably: BonusVehicleID

`
Reply
#3

no. BonusVehicleID Is The Model not The "Vehicleid"

i want to get the vehicleid of bonusvehicleid which is a model
Reply
#4

Uhm. Change that whole thing.
In that command you should create vehicle
pawn Код:
static car;
car = CreateVehicle....
while creating vehicle you can use that random, so it would make a randomed vehicle model.
So when formating text for vehicle id use `car` for model use your randomed thing or just get `car` Model by
pawn Код:
GetVehicleModelFromID(car) // if im not wrong with fuction anyway something like that
Reply
#5

no.. i want any of the model
Reply
#6

So use aVehicleNames[BonusVehicleID-400] ?
Reply
#7

oh.......... why am i so ........ dumb. ty
Reply
#8

You send bonus vehicle download link:$$
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)