Help me /sellvehicle is not working
#1

Anyone fixed this problem of sellvehicle in UGRP. Help me please

Код:
if(strcmp(cmd, "/sellvehicle", true) == 0)
	{
		new pvehicleid = GetPlayerVehicleID(playerid);
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sellvehicle [playerid/PartOfName] [price]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sellvehicle [playerid/PartOfName] [price]");
				return 1;
			}
			new price = strvalEx(tmp);
 	 		if(IsPlayerConnected(giveplayerid))
	    	{
				if(ProxDetectorS(5.0, playerid, giveplayerid))
				{
					if(IsPlayerInAnyVehicle(playerid))
					{
						if(PlayerVehicleID1[playerid] == pvehicleid)
						{
						 	SellVehicleOffer[giveplayerid] = playerid;
		                    SellVehicleOfferTime[giveplayerid] = 60;
		                    SellVehiclePrice[giveplayerid] = price;
                            SellVehicleSlot[giveplayerid] = 1;
							format(string,sizeof(string),"You have offered to sell your %s to %s for $%d.",PlayerName(playerid), GetVehicleName(GetPlayerVehicleID(playerid)), price);
							SendClientMessage(playerid,COLOR_YELLOW,string);
							format(string,sizeof(string),"%s has just offered to sell you their %s for $%d, /accept vehicle to buy the vehicle.",PlayerName(giveplayerid), GetVehicleName(GetPlayerVehicleID(playerid)), price);
							SendClientMessage(giveplayerid,COLOR_YELLOW,string);
						}
						else if(PlayerVehicleID2[playerid] == pvehicleid)
						{
						 	SellVehicleOffer[giveplayerid] = playerid;
		                    SellVehicleOfferTime[giveplayerid] = 60;
		                    SellVehiclePrice[giveplayerid] = price;
                            SellVehicleSlot[giveplayerid] = 2;
							format(string,sizeof(string),"You have offered to sell your %s to %s for $%d.",vehName[GetVehicleModel(pvehicleid)-400],PlayerName(giveplayerid),price);
							SendClientMessage(playerid,COLOR_YELLOW,string);
							format(string,sizeof(string),"%s has just offered to sell you their %s for $%d, /accept vehicle to buy the vehicle.",PlayerName(playerid),vehName[GetVehicleModel(pvehicleid)-400],price);
							SendClientMessage(giveplayerid,COLOR_YELLOW,string);
						}
						else if(PlayerVehicleID3[playerid] == pvehicleid)
						{
						 	SellVehicleOffer[giveplayerid] = playerid;
		                    SellVehicleOfferTime[giveplayerid] = 60;
		                    SellVehiclePrice[giveplayerid] = price;
                            SellVehicleSlot[giveplayerid] = 3;
							format(string,sizeof(string),"You have offered to sell your %s to %s for $%d.",vehName[GetVehicleModel(pvehicleid)-400],PlayerName(giveplayerid),price);
							SendClientMessage(playerid,COLOR_YELLOW,string);
							format(string,sizeof(string),"%s has just offered to sell you their %s for $%d, /accept vehicle to buy the vehicle.",PlayerName(playerid),vehName[GetVehicleModel(pvehicleid)-400],price);
							SendClientMessage(giveplayerid,COLOR_YELLOW,string);
						}
						else if(PlayerVehicleID4[playerid] == pvehicleid)
						{
						 	SellVehicleOffer[giveplayerid] = playerid;
		                    SellVehicleOfferTime[giveplayerid] = 60;
		                    SellVehiclePrice[giveplayerid] = price;
                            SellVehicleSlot[giveplayerid] = 4;
							format(string,sizeof(string),"You have offered to sell your %s to %s for $%d.",vehName[GetVehicleModel(pvehicleid)-400],PlayerName(giveplayerid),price);
							SendClientMessage(playerid,COLOR_YELLOW,string);
							format(string,sizeof(string),"%s has just offered to sell you their %s for $%d, /accept vehicle to buy the vehicle.",PlayerName(playerid),vehName[GetVehicleModel(pvehicleid)-400],price);
							SendClientMessage(giveplayerid,COLOR_YELLOW,string);
						}
						else if(PlayerVehicleID5[playerid] == pvehicleid)
						{
						 	SellVehicleOffer[giveplayerid] = playerid;
		                    SellVehicleOfferTime[giveplayerid] = 60;
		                    SellVehiclePrice[giveplayerid] = price;
                            SellVehicleSlot[giveplayerid] = 5;
							format(string,sizeof(string),"You have offered to sell your %s to %s for $%d.",vehName[GetVehicleModel(pvehicleid)-400],PlayerName(giveplayerid),price);
							SendClientMessage(playerid,COLOR_YELLOW,string);
							format(string,sizeof(string),"%s has just offered to sell you their %s for $%d, /accept vehicle to buy the vehicle.",PlayerName(playerid),vehName[GetVehicleModel(pvehicleid)-400],price);
							SendClientMessage(giveplayerid,COLOR_YELLOW,string);
						}
						else
						{
						    SendClientMessage(playerid,COLOR_GREY,"	You are not at a vehicle that you own.");
						}
					}
					else
					{
					    SendClientMessage(playerid,COLOR_GREY,"	You are not at any vehicle.");
					}
				}
				else
				{
				    SendClientMessage(playerid,COLOR_GREY,"	You are not near the player.");
				}
			}
			else
			{
			    SendClientMessage(playerid,COLOR_GREY,"	Player Not Connected.");
			}
		}
		return 1;
Reply
#2

Help me please to fixed it !!!!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)