Jump to content
  • 0

[Problema] Tunning & PaintJob


Question

Posted

Salut baieti, am si eu o problema la server-ul de SA:MP. Uitati-va care e problema. Imi cumpar o masina personala, si o tunez, cand sa dau /v tunning sau /v paintjob imi zice ca nu sunt in masina mea. Uitati-va codul.

	        else if(strcmp(x_nr,"tunning",true) == 0)
	        {
	            new carsff;
	            if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carsff = PlayerInfo[playerid][pPcarkey]; }
			    if (carsff != 999)
			    {
				    if(IsPlayerInVehicle(playerid, carsff))
				    {
				        new info[] = "Save Car Mods\nSave All Car Mods\nClear Car Mods\nClear All Car Mods ";
					    ShowPlayerDialog(playerid, 1300, DIALOG_STYLE_LIST,"Choose the Option",info,"Ok","Cancel");
					    SendClientMessage(playerid, COLOR_PINK,"Pentru a salva culoarea si paintjobul masinii folositi comenzile /v color si /v paintjob.");
				    }
				    else
			    	{
				    	SendClientMessage(playerid, COLOR_GRAD1, "* You are not in your vehicle!");
			    	}
			    }
		    	else
			    {
				    SendClientMessage(playerid, COLOR_GRAD1, "* You do not own a car!");
			    }
			}
			else if(strcmp(x_nr,"paintjob",true) == 0)
	        {
                if(PlayerInfo[playerid][pPcarkey] == 999)
	        	{
	            	SendClientMessage(playerid, COLOR_GREY,"   You don't have a vehicle to respray.");
	            	return 1;
	        	}
	        	if(!IsAtPaySpray(playerid))
				{
				    SendClientMessage(playerid, COLOR_GREY,"* You must be at a Pay'n'Spray to do this!");
				    return 1;
				}
	        	if(GetPlayerMoney(playerid) < 5000)
	        	{
	            	SendClientMessage(playerid, COLOR_GREY,"   You don't have enough money for vehicle respray.");
	            	return 1;
	        	}
	        	tmp = strtok(cmdtext, idx);
	        	if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_WHITE, "USAGE: /v paintjob [paintjob(0-3)]");
					return 1;
				}
				new color1;
				color1 = strval(tmp);
				if(color1 < 0 && color1 > 3)
				{
			    	SendClientMessage(playerid, COLOR_GREY, "   Wrong color id!");
			    	return 1;
				}
				new vehid;
				if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { vehid = PlayerInfo[playerid][pPcarkey]; }
				else { return 1; }
	        	if(IsPlayerInVehicle(playerid, vehid))
	        	{
         			CarInfo[vehid][cPaintjob] = color1;
	                GivePlayerMoney(playerid, -5000);
	                GameTextForPlayer(playerid, "~w~Bill for a Paint Respray~n~~r~-$5000", 5000, 1);
	                ChangeVehiclePaintjob(vehid, color1);
	                OnVehUpdate();
					OnPlayerDateUpdate(playerid);
					return 1;
    			}
	        	else
	        	{
	            	SendClientMessage(playerid, COLOR_GREY,"   You are not in your vehicle.");
	            	return 1;
	        	}
	        }

3 answers to this question

Recommended Posts

Posted

Sistemul tau de masini nu e bun deoarece nu iti salveaza datele , pe server apar dar in fisiere nu. Fati loadcars si savecars denou si sa mearga deoarece comanda ta e setata corect pCarKey = 999

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.