/accept vehicle - Command is Bugged.
#1

When the person does /sellvehicle and the other person types /accept vehicle it does not work, but prior to them doing /sellvehicle you can type /accept vehicle and it says you are not being offered. Im not sure what the problem is...

Quote:

else if(strcmp(x_job,"vehicle",true) == 0)
{
new carsellerid = SellVehicleOffer[playerid];
new carsellerslot = SellVehicleSlot[playerid];
new carsellerprice = SellVehiclePrice[playerid];
new Float:X,Float:Y,Float:Z,Float:F;
if(SellVehicleOffer[playerid] != 999)
{
if(PlayerInfo[playerid][pCash] >= carsellerprice)
{
if(IsPlayerConnected(carsellerid))
{
if(ProxDetectorS(10.0, playerid, giveplayerid))
{
if(carsellerslot == 1)
{
GetVehiclePos(PlayerVehicleID1[carsellerid],X,Y,Z);
` GetVehicleZAngle(PlayerVehicleID1[carsellerid],F);
if(PlayerInfo[playerid][PlayerVehicleModel1] == 0)
{
PlayerInfo[playerid][pCash] -= carsellerprice;
GivePlayerMoney(playerid,-carsellerprice);
format(string,sizeof(string)," You have accepted to buy %s's %s For Price : %d.",PlayerName(carsellerid),vehName[PlayerInfo[carsellerid][PlayerVehicleModel1]-400],carsellerprice);
SendClientMessage(playerid,COLOR_YELLOW,string);
format(string,sizeof(string)," You have sold your %s to %s For Price : %s.",vehName[PlayerInfo[carsellerid][PlayerVehicleModel1]-400],PlayerName(playerid),carsellerprice);
SendClientMessage(carsellerid,COLOR_YELLOW,string) ;
ReplacePlayerVehicle(carsellerid, playerid, 1,1); // ReplacePlayerVehicle(seller, buyer, sellerslotid,buyerslotid)
RemovePlayerFromVehicle(carsellerid);
ResetPlayerVehicle(carsellerid,carsellerslot);
CreatePlayerVehicle(playerid,1);
SetVehiclePos(PlayerVehicleID1[playerid],X,Y,Z);
SetVehicleZAngle(PlayerVehicleID1[playerid],F);
}
else if(PlayerInfo[playerid][PlayerVehicleModel2] == 0)
{
PlayerInfo[playerid][pCash] -= carsellerprice;
GivePlayerMoney(playerid,-carsellerprice);
format(string,sizeof(string)," You have accepted to buy %s's %s For Price : %d.",PlayerName(carsellerid),vehName[PlayerInfo[carsellerid][PlayerVehicleModel1]-400],carsellerprice);
SendClientMessage(playerid,COLOR_YELLOW,string);
format(string,sizeof(string)," You have sold your %s to %s For Price : %s.",vehName[PlayerInfo[carsellerid][PlayerVehicleModel1]-400],PlayerName(playerid),carsellerprice);
SendClientMessage(carsellerid,COLOR_YELLOW,string) ;
ReplacePlayerVehicle(carsellerid, playerid, 1,2); // ReplacePlayerVehicle(seller, buyer, sellerslotid,buyerslotid)
RemovePlayerFromVehicle(carsellerid);
ResetPlayerVehicle(carsellerid,carsellerslot);
CreatePlayerVehicle(playerid,2);
SetVehiclePos(PlayerVehicleID2[playerid],X,Y,Z);
SetVehicleZAngle(PlayerVehicleID2[playerid],F);
}
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You can't afford that !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nobody offered you to sell his vehicle !");
return 1;
}
}
else
{
return 1;
}
}
return 1;
}

Reply
#2

bump
Reply
#3

BUMP, Will pay who ever fixes this. But they must send it to me first.
Thanks +REP.
Reply
#4

Quote:
Originally Posted by Kayla_Swade
Посмотреть сообщение
BUMP, Will pay who ever fixes this. But they must send it to me first.
Thanks +REP.
1. yeah, of course you'll pay...
2. stop spamming
3. it's very hard to look at your code due to the lack of indentations
Reply
#5

1. Indentations do not matter...
2. What do you mean? If you cannot help me please refrain from being on this post.
Reply
#6

He means there are [CODE] and [PHP] tags on forums for a reason, not even you can read your own post, please repost your code under one of those tags so it's readable and we can help you
and "paying" won't speed up the helping process, having pawn knowledge to understand other's help and explaining the issue better will help you get faster responses, so try those !
Reply
#7

Код:
else if(strcmp(x_job,"vehicle",true) == 0)
{
new carsellerid = SellVehicleOffer[playerid];
new carsellerslot = SellVehicleSlot[playerid];
new carsellerprice = SellVehiclePrice[playerid];
new Float:X,Float:Y,Float:Z,Float:F;
if(SellVehicleOffer[playerid] != 999)
{
if(PlayerInfo[playerid][pCash] >= carsellerprice)
{
if(IsPlayerConnected(carsellerid))
{
if(ProxDetectorS(10.0, playerid, giveplayerid))
{
if(carsellerslot == 1)
{
GetVehiclePos(PlayerVehicleID1[carsellerid],X,Y,Z);
`	GetVehicleZAngle(PlayerVehicleID1[carsellerid],F);
if(PlayerInfo[playerid][PlayerVehicleModel1] == 0)
{
PlayerInfo[playerid][pCash] -= carsellerprice;
GivePlayerMoney(playerid,-carsellerprice);
format(string,sizeof(string),"	You have accepted to buy %s's %s For Price : %d.",PlayerName(carsellerid),vehName[PlayerInfo[carsellerid][PlayerVehicleModel1]-400],carsellerprice);
SendClientMessage(playerid,COLOR_YELLOW,string);
format(string,sizeof(string),"	You have sold your %s to %s For Price : %s.",vehName[PlayerInfo[carsellerid][PlayerVehicleModel1]-400],PlayerName(playerid),carsellerprice);
SendClientMessage(carsellerid,COLOR_YELLOW,string) ;
ReplacePlayerVehicle(carsellerid, playerid, 1,1); // ReplacePlayerVehicle(seller, buyer, sellerslotid,buyerslotid)
RemovePlayerFromVehicle(carsellerid);
ResetPlayerVehicle(carsellerid,carsellerslot);
CreatePlayerVehicle(playerid,1);
SetVehiclePos(PlayerVehicleID1[playerid],X,Y,Z);
SetVehicleZAngle(PlayerVehicleID1[playerid],F);
}
else if(PlayerInfo[playerid][PlayerVehicleModel2] == 0)
{
PlayerInfo[playerid][pCash] -= carsellerprice;
GivePlayerMoney(playerid,-carsellerprice);
format(string,sizeof(string),"	You have accepted to buy %s's %s For Price : %d.",PlayerName(carsellerid),vehName[PlayerInfo[carsellerid][PlayerVehicleModel1]-400],carsellerprice);
SendClientMessage(playerid,COLOR_YELLOW,string);
format(string,sizeof(string),"	You have sold your %s to %s For Price : %s.",vehName[PlayerInfo[carsellerid][PlayerVehicleModel1]-400],PlayerName(playerid),carsellerprice);
SendClientMessage(carsellerid,COLOR_YELLOW,string) ;
ReplacePlayerVehicle(carsellerid, playerid, 1,2); // ReplacePlayerVehicle(seller, buyer, sellerslotid,buyerslotid)
RemovePlayerFromVehicle(carsellerid);
ResetPlayerVehicle(carsellerid,carsellerslot);
CreatePlayerVehicle(playerid,2);
SetVehiclePos(PlayerVehicleID2[playerid],X,Y,Z);
SetVehicleZAngle(PlayerVehicleID2[playerid],F);
}
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You can't afford that !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nobody offered you to sell his vehicle !");
return 1;
}
}
else
{
return 1;
}
}
return 1;
}
There you. I apologize.
Reply
#8

Quote:
Originally Posted by Kayla_Swade
Посмотреть сообщение
1. Indentations do not matter...
2. What do you mean? If you cannot help me please refrain from being on this post.
1. Yes they do, when you need help, you want people to read your code easily, right?
2. Just because you don't know what I mean doesn't mean I'm not helping. I meant "stop spamming" as in stop bumping your post so quickly, it's against the forum rules.

3. Your code is still pretty hard to read without those indentations.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)