- 0
[GF/RP] Problema sellcar
-
Similar Content
-
Recently Browsing 0 members
- No registered users viewing this page.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.
Question
Otiy
Atunci cand un carjacker da sellcar nu ii da bani va rog ajutatima
[pawn]if(strcmp(cmd,"/sellcar",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] != 10)
{
SendClientMessage(playerid,COLOR_GREY," You are not a Car Dealer !");
return 1;
}
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid,COLOR_GREY," You are not in a Car !");
return 1;
}
if(IsAnOwnableCar(idcar))
{
SendClientMessage(playerid,COLOR_GREY," Use /v sellto to sell you car to other person !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sellcar [playerid/PartOfName] [price]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sellcar [playerid/PartOfName] [price]");
return 1;
}
new money = strval(tmp);
if(money < 1 || money > 6000000) { SendClientMessage(playerid, COLOR_GREY, " Price not below $1 or above &6000000 !"); return 1; }
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_GREY, " Cant sell to yourself!");
return 1;
}
if(CarCalls[giveplayerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " That player has already bought a car, has to use /callcar first !");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* You offerd %s to buy your Car for $%d .", giveplayer, money);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Car Dealer %s wants to sell you his Car for $%d, (type /accept car) to buy.", sendername, money);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
CarOffer[giveplayerid] = playerid;
CarPrice[giveplayerid] = money;
CarID[giveplayerid] = GetPlayerVehicleID(playerid);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is not near you !");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Invalid ID/Name !");
return 1;
}
}
return 1;
}[/pawn]
acesta este codu sellcar
5 answers to this question
Recommended Posts