hi I make a litle reedit of your code .... for owned vehicles it add Plate for it ... and for buyable add a plate with
CarBuy ...
code ...
Код:
/* By ben4uka \ Cola \ ColaMan \ FreeRide \ freerides (this is my nicknames)
Recoded by m0k1 for 0.3c !*/
//Includes
#include <a_samp>
#include <dini>
//Defines
#define lb 0x33CCFFAA
#define white 0xFFFFFFAA
#define red 0xFF0000AA
#define Orange 0xFF9900AA
#define green 0x16EB43FF
// News
new file[256];
new colors[200] = {
0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,0xf0e68cFF,0x778899FF,0xFF1493FF,0xF4A460FF,
0xEE82EEFF,0xFFD720FF,0x8b4513FF,0x4949A0FF,0x148b8bFF,0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,0x10DC29FF,
0x534081FF,0x0495CDFF,0xEF6CE8FF,0xBD34DAFF,0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,0x65ADEBFF,
0x5C1ACCFF,0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF,0x275222FF,0xF09F5BFF,0x3D0A4FFF,
0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,0x3793FAFF,0x90239DFF,0xE9AB2FFF,0xAF2FF3FF,0x057F94FF,
0xB98519FF,0x388EEAFF,0x028151FF,0xA55043FF,0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,0x18F71FFF,
0x4B8987FF,0x491B9EFF,0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,0x3C1C0DFF,0x12D6D4FF,
0x48C000FF,0x2A51E2FF,0xE3AC12FF,0xFC42A8FF,0x2FC827FF,0x1A30BFFF,0xB740C2FF,0x42ACF5FF,0x2FD9DEFF,
0xFAFB71FF,0x05D1CDFF,0xC471BDFF,0x94436EFF,0xC1F7ECFF,0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,0x3214AAFF,
0x184D3BFF,0xAE4B99FF,0x7E49D7FF,0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF,0x9F945CFF,0xDCDE3DFF,
0x10C9C5FF,0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,0xE59338FF,0xEEDC2DFF,0xD8C762FF,
0xD8C762FF,0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,0xf0e68cFF,0x778899FF,0xFF1493FF,
0xF4A460FF,0xEE82EEFF,0xFFD720FF,0x8b4513FF,0x4949A0FF,0x148b8bFF,0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,
0x10DC29FF,0x534081FF,0x0495CDFF,0xEF6CE8FF,0xBD34DAFF,0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,
0x65ADEBFF,0x5C1ACCFF,0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF,0x275222FF,0xF09F5BFF,
0x3D0A4FFF,0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,0x3793FAFF,0x90239DFF,0xE9AB2FFF,0xAF2FF3FF,
0x057F94FF,0xB98519FF,0x388EEAFF,0x028151FF,0xA55043FF,0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,
0x18F71FFF,0x4B8987FF,0x491B9EFF,0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,0x3C1C0DFF,
0x12D6D4FF,0x48C000FF,0x2A51E2FF,0xE3AC12FF,0xFC42A8FF,0x2FC827FF,0x1A30BFFF,0xB740C2FF,0x42ACF5FF,
0x2FD9DEFF,0xFAFB71FF,0x05D1CDFF,0xC471BDFF,0x94436EFF,0xC1F7ECFF,0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,
0x3214AAFF,0x184D3BFF,0xAE4B99FF,0x7E49D7FF,0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF,0x9F945CFF,
0xDCDE3DFF,0x10C9C5FF,0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,0xE59338FF,0xEEDC2DFF,
0xD8C762FF,0xD8C762FF
};
new Text3D:TextUpCar[MAX_VEHICLES];
new VCount;
new TextCar[256];
new VehNames[212][] =
{
"Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster",
"Stretch","Manana","Infernus","Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto",
"Taxi","Washington","Bobcat","Mr Whoopee","BF Injection","Hunter","Premier","Enforcer","Securicar","Banshee",
"Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie","Stallion","Rumpo",
"RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer",
"Turismo","Speeder","Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer",
"Pcj - 600","Faggio","Freeway","RC Baron","RC Raider","Glendale","Oceanic","Sanchez","Sparrow","Patriot",
"Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","Zr3 50","Walton","Regina","Comet","Bmx",
"Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo",
"Greenwood","Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa",
"RC Goblin","Hotring Racer A","Hotring Racer B","Bloodring Banger","Rancher","Super GT","Elegant",
"Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain","Nebula","Majestic",
"Buccaneer","Shamal","Hydra","Fcr - 900","Nrg - 500","Hpv - 1000","Cement Truck","Tow Truck","Fortune","Cadrona",
"FBI Truck","Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight",
"Streak","Vortex","Vincent","Bullet","Clover","Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob",
"Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A","Monster B","Uranus",
"Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight",
"Trailer","Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford",
"BF-400","Newsvan","Tug","Trailer A","Emperor","Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C",
"Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)","Police Car (LVPD)","Police Ranger",
"Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",
"Stair Trailer","Boxville","Farm Plow","Utility Trailer"
};
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
VCount = CreateVehicle(411,0,0,0,0,0,0,-1);
DestroyVehicle(VCount);
for(new v=1; v < VCount; v++)
{
if(dini_Int(CarFile(v),"Public") == 0 && dini_Int(CarFile(v),"Owned") == 1)
{
SetVehicleNumberPlate(GetPlayerVehicleID(playerid), "%",dini_Get(CarFile(v),"Owner");
}
else if(dini_Int(CarFile(v),"Public") == 1)
{
SetVehicleNumberPlate(GetPlayerVehicleID(playerid), "141dsv"");
}
else if(dini_Int(CarFile(v),"Public") == 0 && dini_Int(CarFile(v),"Owned") == 0)
{
format(TextCar,sizeof(TextCar),"This car %s\nIs BuyAble\nIn 200000$",VehNames[GetVehicleModel(v)-400]);
TextUpCar[v] = Create3DTextLabel(TextCar,colors[random(sizeof(colors))],0,0,0,25.0,0);
Attach3DTextLabelToVehicle(TextUpCar[v],v,0.0,0.0,0.0);
SetVehicleNumberPlate(GetPlayerVehicleID(playerid), "ForSell");
}
}
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
Attach3DTextLabelToVehicle(TextUpCar[vehicleid],vehicleid,0.0,0.0,0.0);
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256], vehicleid = GetPlayerVehicleID(playerid), v = GetPlayerVehicleID(playerid), idx, str[256];
cmd = strtok(cmdtext, idx);
if(!strcmp(cmd,"/BuyCar",true))
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"You are not in a vehicle");
if(dini_Int(CarFile(vehicleid),"Owned")==1) return SendClientMessage(playerid,red," this car is alredy owned.");
if(dini_Int(CarFile(vehicleid),"Public")==1) return SendClientMessage(playerid,red," this car is unbuyable ");
if(dini_Int(PFile(playerid),"GotCar")==1) return SendClientMessage(playerid,red,"you alredy have a car ");
if(GetPlayerMoney(playerid) < 200000) return SendClientMessage(playerid,red,"You dont have the money (200000$)");
if(!dini_Exists(PFile(playerid)))
{
dini_Create(PFile(playerid));
dini_IntSet(PFile(playerid),"GotCar",1);
dini_IntSet(PFile(playerid),"CarId",vehicleid);
}
else if(dini_Exists(PFile(playerid)))
{
dini_IntSet(PFile(playerid),"GotCar",1);
dini_IntSet(PFile(playerid),"CarId",vehicleid);
}
if(!dini_Exists(CarFile(vehicleid)))
{
dini_Create(CarFile(vehicleid));
dini_Set(CarFile(vehicleid),"Owner",Gn(playerid));
dini_IntSet(CarFile(vehicleid),"Owned",1);
}
else if(dini_Exists(CarFile(vehicleid)))
{
dini_Set(CarFile(vehicleid),"Owner",Gn(playerid));
dini_IntSet(CarFile(vehicleid),"Owned",1);
}
format(str,256,"You bought a new %s",VehNames[GetVehicleModel(vehicleid)-400]);
SendClientMessage(playerid,green,str);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
SendClientMessage(playerid,white,"To call your car use /CallCar");
format(TextCar,sizeof(TextCar),"This car %s\nBelong To %s",VehNames[GetVehicleModel(v)-400],dini_Get(CarFile(v),"Owner"));
Update3DTextLabelText(TextUpCar[vehicleid],colors[random(sizeof(colors))],TextCar);
Attach3DTextLabelToVehicle(TextUpCar[vehicleid],vehicleid,0.0,0.0,0.0);
GivePlayerMoney(playerid,-200000);
return 1;
}
if(!strcmp(cmd,"/SellCar",true))
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"You are not in a vehicle");
if(dini_Int(PFile(playerid),"GotCar")==0) return SendClientMessage(playerid,red,"you dont have a car");
if(vehicleid!=Pc(playerid)) return SendClientMessage(playerid,red," this isn't your car");
dini_IntSet(CarFile(vehicleid),"Owner",0);
dini_IntSet(CarFile(vehicleid),"Owned",0);
dini_IntSet(CarFile(vehicleid),"Public",0);
dini_IntSet(PFile(playerid),"GotCar",0);
dini_Set(PFile(playerid),"CarId","None");
dini_Remove(CarFile(vehicleid));
SendClientMessage(playerid,green," you sold your car, you get a half from the money");
format(TextCar,sizeof(TextCar),"this car %s\nIs buyable\nIn 200000$",VehNames[GetVehicleModel(v)-400]);
Update3DTextLabelText(TextUpCar[vehicleid],colors[random(sizeof(colors))],TextCar);
Attach3DTextLabelToVehicle(TextUpCar[vehicleid],vehicleid,0.0,0.0,0.0);
GivePlayerMoney(playerid,100000);
return 1;
}
if(!strcmp(cmd,"/CallCar",true))
{
if(dini_Int(PFile(playerid),"GotCar") == 0) return SendClientMessage(playerid,red,"you dont have a car");
if(IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,red,"you alredy in a vehicle");
new Float:p[4];
GetPlayerPos(playerid,p[0],p[1],p[2]);
GetPlayerFacingAngle(playerid,p[3]);
SetVehiclePos(Pc(playerid),p[0],p[1],p[2]);
SetVehicleZAngle(Pc(playerid),p[3]);
PutPlayerInVehicle(playerid,Pc(playerid),0);
SendClientMessage(playerid,0xFF9900AA," Thank You for using Car Teleport Service!");
return 1;
}
if(!strcmp(cmd,"/UnBuyAble",true))
{
if(!IsPlayerAdmin(playerid)) return 0;
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"you are not in a vehicle");
if(dini_Int(CarFile(vehicleid),"Public")==1) return SendClientMessage(playerid,red,"this car is alredy public");
if(!dini_Exists(CarFile(vehicleid)))
{
dini_Create(CarFile(vehicleid));
dini_IntSet(CarFile(vehicleid),"Public",1);
dini_IntSet(CarFile(vehicleid),"Owned",0);
dini_IntSet(CarFile(vehicleid),"Owner",0);
}
else
{
dini_IntSet(CarFile(vehicleid),"Public",1);
dini_IntSet(CarFile(vehicleid),"Owned",0);
dini_IntSet(CarFile(vehicleid),"Owner",0);
}
SendClientMessage(playerid,green,"this car is now public.");
format(TextCar,sizeof(TextCar),"%s Is UnBuyAble!", VehNames[GetVehicleModel(v)-400]);
Update3DTextLabelText(TextUpCar[vehicleid],colors[random(sizeof(colors))],TextCar);
Attach3DTextLabelToVehicle(TextUpCar[vehicleid],vehicleid,0.0,0.0,0.0);
return 1;
}
if(!strcmp(cmd,"/BuyAble",true))
{
if(!IsPlayerAdmin(playerid)) return 0;
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"you are not in a vehicle");
if(dini_Int(CarFile(vehicleid),"Public")==0) return SendClientMessage(playerid,red,"this isnt a public car");
dini_IntSet(CarFile(vehicleid),"Public",0);
dini_IntSet(CarFile(vehicleid),"Owned",0);
dini_IntSet(CarFile(vehicleid),"Owner",0);
dini_Remove(CarFile(vehicleid));
SendClientMessage(playerid,green,"this car is now buyable");
format(TextCar,sizeof(TextCar),"this car %s\nIs buyable\nIn 200000$",VehNames[GetVehicleModel(v)-400]);
Update3DTextLabelText(TextUpCar[vehicleid],colors[random(sizeof(colors))],TextCar);
Attach3DTextLabelToVehicle(TextUpCar[vehicleid],vehicleid,0.0,0.0,0.0);
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
stock Gn(playerid)
{
new pname[24];
GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
return pname;
}
stock CarFile(vehicleid)
{
new Car[64];
format(Car,64,"Cars/%d.ini",vehicleid);
return Car;
}
stock PFile(playerid)
{
format(file,64,"Cars/Users/%s.ini",Gn(playerid));
return file;
}
stock Pc(playerid) return dini_Int(PFile(playerid),"CarId");