bonus vehicle problem.. -
The_Gangstas - 14.11.2010
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
Re: bonus vehicle problem.. -
GaGlets(R) - 14.11.2010
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
`
Re: bonus vehicle problem.. -
The_Gangstas - 14.11.2010
no. BonusVehicleID Is The Model not The "Vehicleid"
i want to get the vehicleid of bonusvehicleid which is a model
Re: bonus vehicle problem.. -
GaGlets(R) - 14.11.2010
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
Re: bonus vehicle problem.. -
The_Gangstas - 15.11.2010
no.. i want any of the model
Re: bonus vehicle problem.. -
Jefff - 15.11.2010
So use aVehicleNames[BonusVehicleID-400] ?
Re: bonus vehicle problem.. -
The_Gangstas - 15.11.2010
oh.......... why am i so ........ dumb. ty
Re: bonus vehicle problem.. -
azzeroth - 28.01.2011
You send bonus vehicle download link
:$$