//=============================[3.Vehicle Sellto Bug]====================================//
Description of Bug: You offer a car to a player but don't exist a command for accept the car (example: /accept ownablecar) I want to make a command wich ACCEPT THE OWNABLE CAR
Codes:
Code:
else if(strcmp(x_nr,"sellto",true) == 0)
{
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey1] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2])
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new ownvehkey;
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey1]) { ownvehkey = PlayerInfo[playerid][pPcarkey1]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { ownvehkey = PlayerInfo[playerid][pPcarkey2]; }
else { return 1; }
if(strcmp(sendername, CarInfo[ownvehkey][cOwner], true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "HINT: /v sellto [playerid/PartOfName] [price]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(ProxDetectorS(8.0, playerid, giveplayerid))
{
if(PlayerInfo[giveplayerid][pPcarkey1] == 999)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "HINT: /v sellto [playerid/PartOfName] [price]");
return 1;
}
new price;
price = strval(tmp);
if(price < 1 || price > 1500000)
{
SendClientMessage(playerid, COLOR_GREY, " Price not lower then 1 and not higher then 1500000. ");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You offerd %s to buy your car for $%d .", giveplayer, price);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Car Owner %s offered you to buy his/her car for $%d (type /accept ownablecar) to buy.", playername, price);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
OwnableCarOffer[giveplayerid] = playerid;
OwnableCarID[giveplayerid] = ownvehkey;
OwnableCarPrice[giveplayerid] = price;
return 1;
}
else if(PlayerInfo[giveplayerid][pPcarkey2] == 999)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "HINT: /v sellto [playerid/PartOfName] [price]");
return 1;
}
new price;
price = strval(tmp);
if(price < 1 || price > 1500000)
{
SendClientMessage(playerid, COLOR_GREY, " Price not lower then 1 and not higher then 1500000. ");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You offerd %s to buy your car for $%d .", giveplayer, price);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Car Owner %s offered you to buy his/her car for $%d (type /accept ownablecar) to buy.", playername, price);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
OwnableCarOffer[giveplayerid] = playerid;
OwnableCarID[giveplayerid] = ownvehkey;
OwnableCarPrice[giveplayerid] = price;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Player is not near you ! ");
return 1;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " This is not your car");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You have to sit at your own car to sell it");
return 1;
}
}
//===================================[4. Some Warnings]====================================
- There are some warnings on compile:
Code:
- JunkBuster.inc(3248) : warning 201: redefinition of constant/macro (symbol "OnPlayerEnterRaceCheckpoint")
- GM.pwn(14833) : warning 202: number of arguments does not match definition
- GM.pwn(43001) : warning 203: symbol is never used: "Turfs"
And the lines:
Code:
Line number 14833 in GameMode:
ShowPlayerDialog(playerid, 50, DIALOG_STYLE_MSGBOX," Message 1 \nMessage 2.","Ok","Cancel");
Code:
Line number 43001 in GameMode:
LOL - THIS LINE IS THE END OF GAMEMODE, NOTHING THERE