SA-MP Forums Archive
Help with command for admin-sell vehicles - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with command for admin-sell vehicles (/showthread.php?tid=375329)



Help with command for admin-sell vehicles - UnknownGamer - 06.09.2012

Hi,

Does anybody know how to define the username of the player who owns the car that I'm in? I've looked at SA-MP Wiki so don't say try looking there.

Getplayervehicleid[playerid]; Just defines the player-id, not the username, therefore it's only editing the actual car Owned to The State, and Owned = 0.

But the actual username would still own car id 3/4/5/6 etc, causing cars to mess up. I need a way for it to edit there car/car2 values to 9999.

Located in LARP/Users/%s.ini (%s been the username).

I currently have a Dini_Iniset but for some reason when I admin-sell it, It doesn't set the users car value to 9999.

None working code, need a possible fix, if possible, please.
Код:
				// Fixed Car System

         		for(new i = 0; i < MAX_PLAYERS; i ++)
			    {
			        if(IsPlayerConnected(i))
			        {
						if(PlayerInfo[i][pPcarkey] == vehid || PlayerInfo[i][pPcarkey2] == vehid)
			            {
			                if(PlayerInfo[i][pPcarkey] == vehid) PlayerInfo[i][pPcarkey] = 9999;
			                else if(PlayerInfo[i][pPcarkey2] == vehid) PlayerInfo[i][pPcarkey2] = 9999;

			                SafeGivePlayerMoney(i, GetVehiclePrice(vehid) / 2);
						}
						else
						{
						    format(string, sizeof(string),"LARP/Users/%s.ini",CarInfo[vehid][cOwner]);
			         		new totalcash = dini_Int(string,"Money") + GetVehiclePrice(vehid);
			         		dini_IntSet(string,"Money",totalcash);

			         		if(dini_Int(string,"Car") == vehid)
			         		{
			         		    dini_IntSet(string,"Car",9999);
			         		    strmid(PlayerInfo[i][pPcarkey], "9999", 0, strlen("9999"), 9999);
							}
							else if(dini_Int(string,"Car2") == vehid)
			         		{
			         		    dini_IntSet(string,"Car2",9999);
			         		    strmid(PlayerInfo[i][pPcarkey], "9999", 0, strlen("9999"), 9999);
							}
						}
					}
				}

				// End Of Fix for the Car-Sell system //



Re: Help with command for admin-sell vehicles - UnknownGamer - 06.09.2012

BUMP!! Need this asap!


Re : Help with command for admin-sell vehicles - ricardo178 - 07.09.2012

Editing Raven's Role-Play is a pain in ass and the worse thing you can try... Plus it's all about old scripting, which people don't know almost anything now-a-days..


Re: Re : Help with command for admin-sell vehicles - UnknownGamer - 07.09.2012

Quote:
Originally Posted by ricardo178
Посмотреть сообщение
Editing Raven's Role-Play is a pain in ass and the worse thing you can try... Plus it's all about old scripting, which people don't know almost anything now-a-days..
I know rite, haha. I'm trying to make a fix for everybody. Not to just use for my-self. It'll be released when it's stable.