bonus vehicle problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: bonus vehicle problem (
/showthread.php?tid=187840)
bonus vehicle problem -
The_Gangstas - 05.11.2010
pawn Код:
new BonusVehiclePrize,BonusVehicleID;
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);
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.");
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),"Bonus:%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;
}
but when i try to sell a buffalo ( if thats the bonus vehiclemodel ) it says its not the bonus vehicle..
Re: bonus vehicle problem -
(SF)Noobanatior - 05.11.2010
PHP код:
CMD:sell(playerid,params)
{
if(IsPlayerInDynamicCP(playerid,CraneCp))
{
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),"Bonus:%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;
}
bracket it the wrong place here shoulbe like this
if(GetVehicleModel(GetPlayerVehicleID(playerid)) != BonusVehicleID)
Re: bonus vehicle problem -
The_Gangstas - 10.11.2010
bump... 8char..
doesnt work
Re: bonus vehicle problem -
rs.pect - 10.11.2010
Then do some debug, for example, add
pawn Код:
printf("DEBUG: player's: %d; variable: %d;", GetVehicleModel(GetPlayerVehicleID(playerid)), BonusVehicleID);
after
pawn Код:
if(IsPlayerInDynamicCP(playerid,CraneCp))
{
Use this command and you will get info in console.
Re: bonus vehicle problem -
The_Gangstas - 13.11.2010
bump (8char)
Re: bonus vehicle problem -
The_Gangstas - 13.11.2010
bump.....
Re: bonus vehicle problem -
MadeMan - 13.11.2010
pawn Код:
format(str,sizeof(str),"The Bonus Vehicle Today Is The %s, Sell This Vehicle To The Crane For $%d",aVehicleNames[BonusVehicleID-400],BonusVehiclePrize);
Don't use GetVehicleModel in there.