HELP >> COMMAND
#1

Hi there ! I have an edited version of IBP. So, I have a /showcarid command which show the player id all the details about the car, like: color, lincses plate, name of the owner and etc..

So, it's bugged. It works almost perfectly. If i'm not in a car it tells me that I need to be in a car and anything else.

But, when I'm the driver and type /showcarid PLAYERID, like.. /showcarid 24 it's not working-.. It doesn't give to the player the informations. Like, it doesn't show to the player id 24 information(the upper example.)

Ah, almost forgot. You can't show the car id if the car you drive isn't yours.

Код:
	if(strcmp(cmd, "/showcarid", true) == 0 || strcmp(cmd, "/showmycarid", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "Trebuie sa te loghezi!");
	            return 1;
	        }
	        new vehi = GetPlayerVehicleID(playerid);
	        if(PlayerInfo[playerid][pCarKey] != vehi || PlayerInfo[playerid][pCarKey] != vehi)
	        {
	           SendClientMessage(playerid, COLOR_LIGHTRED, "Aceasta nu este masina ta.");
               return 1;
	        }
	        if(!IsPlayerInAnyVehicle(playerid))
			{
	            SendClientMessage(playerid, COLOR_WHITE, "Nu esti intr-un vehicul.");
	            return 1;
			}
			if(GetPlayerVehicleID(playerid) <= 89)
			{
	            return 1;
			}
	        tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
			    SendClientMessage(playerid, COLOR_GRAD2, "{FFFFFF}Folosire{696969}: /showcarid [playerid/PartOfName]");
			    return 1;
			}
            giveplayerid = ReturnUser(tmp);
			if(IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
			        if(ProxDetectorS(8.0, playerid, giveplayerid))
			        {
			            GetPlayerName(playerid, sendername, sizeof(sendername));
			            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
	            		SendClientMessage(giveplayerid, COLOR_GREEN, "_______Talonul masinii_______");
	            		format(string, sizeof(string), "Nume detinator: {F6E007}%s", GetPlayerNameEx(playerid));
	            		SendClientMessage(giveplayerid, COLOR_WHITE, string);
	            		format(string, sizeof(string), "Modelul masinii: {F6E007}%s", VehicleNames[GetVehicleModel(PlayerInfo[playerid][pCarKey])-400]);
				        SendClientMessage(giveplayerid, COLOR_WHITE, string);
                        format(string, sizeof(string), "Serie sasiu: {F6E007}%d", VehicleInfo[vehi][vSasiu]);
						SendClientMessage(giveplayerid, COLOR_WHITE, string);
						format(string, sizeof(string), "Culoarea masinii: {F6E007}%d", VehicleInfo[vehi][vColorOne]);
						SendClientMessage(giveplayerid, COLOR_WHITE, string);
						format(string, sizeof(string), "Numar de imatriculare: {F6E007}%s", VehicleInfo[vehi][vPlate]);
						SendClientMessage(giveplayerid, COLOR_WHITE, string);
						if(VehicleInfo[vehi][vInsurances] >= 1)
	            		{
							format(string, sizeof(string), "Asigurare: {117000}VALIDA", VehicleInfo[vehi][vPlate]);
							SendClientMessage(giveplayerid, COLOR_WHITE, string);
						}
						else
						{
							format(string, sizeof(string), "Asigurare: {FF0000}INVALIDA", VehicleInfo[vehi][vPlate]);
							SendClientMessage(giveplayerid, COLOR_WHITE, string);
						}
						if(VehicleInfo[vehi][vVerify] == 0)
						{
							format(string, sizeof(string), "Inspectie tehnica: {FF0000}INVALIDA", VehicleInfo[vehi][vPlate]);
							SendClientMessage(giveplayerid, COLOR_WHITE, string);
						}
						if(VehicleInfo[vehi][vVerify] == 1)
						{
							format(string, sizeof(string), "Inspectie tehnica: {117000}VALIDA", VehicleInfo[vehi][vPlate]);
							SendClientMessage(giveplayerid, COLOR_WHITE, string);
						}
						if(VehicleInfo[vehi][vVer1] != 0 && VehicleInfo[vehi][vVer2] != 0 && VehicleInfo[vehi][vVer3] != 0)
						{
							format(string, sizeof(string), "Data inspectiei: {F6E007}%d/%d/%d", VehicleInfo[vehi][vVer1], VehicleInfo[vehi][vVer2], VehicleInfo[vehi][vVer3]);
							SendClientMessage(giveplayerid, COLOR_WHITE, string);
						}
						if(VehicleInfo[vehi][vVerifyBy] != 0)
						{
							format(string, sizeof(string), "Mecanic: {F6E007}%s", VehicleInfo[vehi][vVerifyBy]);
							SendClientMessage(giveplayerid, COLOR_WHITE, string);
						}
	            		if(PlayerInfo[playerid][pSex] == 1)
	            		{
	            			PlayerPlayerActionMessage(playerid,giveplayerid,20.0,"scoate talonul si il arata lui");
						} else {
							PlayerPlayerActionMessage(playerid,giveplayerid,20.0,"scoate talonul si il arata lui");
						}
	            		return 1;
			        }
			    }
			}
	    }
	    return 1;
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)