Help with command for admin-sell vehicles
#1

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 //
Reply
#2

BUMP!! Need this asap!
Reply
#3

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..
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)