23.01.2013, 20:23
Hello!
I seem to be struggling with something.
We have VIP Cars and such and we're trying to prevent them from being sold in game. This is what i've came up with
It still allows the sale of the vehicles, despite my efforts. Maybe i'm overlooking something. Any ideas?
I seem to be struggling with something.
We have VIP Cars and such and we're trying to prevent them from being sold in game. This is what i've came up with
pawn Код:
public IsAMAXerCar(vehicleid)
{
new maxcar = GetVehicleModel(vehicleid);
if(maxcar == 400 || maxcar == 404 || maxcar == 413 || maxcar == 418 || maxcar == 479 || maxcar == 482 || maxcar == 491 || maxcar == 518,
maxcar == 543 || maxcar == 547 || maxcar == 554 || maxcar == 561 || maxcar == 600 || maxcar == 421 || maxcar == 422 || maxcar == 458,
maxcar == 474 || maxcar == 483 || maxcar == 489 || maxcar == 500 || maxcar == 507 || maxcar == 516 || maxcar == 527 || maxcar == 533,
maxcar == 549 || maxcar == 551 || maxcar == 402 || maxcar == 409 || maxcar == 424 || maxcar == 434 || maxcar == 445 || maxcar == 447,
maxcar == 453 || maxcar == 463 || maxcar == 484 || maxcar == 545 || maxcar == 555 || maxcar == 595 || maxcar == 568 || maxcar == 519,
maxcar == 423 || maxcar == 580)
{
return 0;
}
return 1;
}
if(strcmp(cmd, "/sellcar", true) == 0)
{
//if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You must be in a vehicle to use this command!");
new ivID = GetPlayerVehicleID(playerid),
Float:Pos[4];
GetVehiclePos(ivID, Pos[0], Pos[1], Pos[2]);
GetVehicleZAngle(ivID, Pos[3]);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid, COLOR_WHITE, "{00FF00}Usage:{FFFFFF} /sellcar <playerid/PartOfName> <price>");
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid, COLOR_WHITE, "{00FF00}Usage:{FFFFFF} /sellcar <playerid/PartOfName> <price>");
}
moneys = strvalEx(tmp);
if(moneys >= 1) {} else return 1;
if(IsAMAXerCar(ivID)) return SendClientMessage(playerid,-1,"You may not sell MAXer vehicles.");
if(OwnedVeh(ivID) != 0)