Jump to content
  • 0

Salvare tuning dupa /v park


mafia_wars

Question

Cum sa fak sa salvezi masina tunata dupa /v park

[pawn] if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0) // By Ellis

{

    if(IsPlayerConnected(playerid))

    {

        if(gPlayerLogged[playerid] == 0)

        {

            SendClientMessage(playerid, COLOR_GREY, "  Trebue sa te autentifici intai ! ");

            return 1;

        }

        new x_nr[64];

        x_nr = strtok(cmdtext, idx);

        if(!strlen(x_nr))

        {

            SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]");

            SendClientMessage(playerid, COLOR_WHITE, "Available names: park, lock, sell, color, tow, locate");

            return 1;

        }

else if(strcmp(x_nr,"park",true) == 0)

        {

        if(!IsAtDealership(playerid))

            {

            new Float:x,Float:y,Float:z;

new Float:a;

new carid;

new getcarid;

if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }

else { return 1; }

getcarid = GetPlayerVehicleID(playerid);

GetPlayerName(playerid, playername, sizeof(playername));

GetVehiclePos(carid, x, y, z);

//GetPlayerFacingAngle(playerid, a);

GetVehicleZAngle(carid, a);

if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)

{

  if(PlayerInfo[playerid][pPcarkey] == 999)

{

SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");

return 1;

}

if(getcarid == carid)

{

CarInfo[carid][cLocationx] = x;

CarInfo[carid][cLocationy] = y;

CarInfo[carid][cLocationz] = z;

CarInfo[carid][cAngle] = a;

format(string, sizeof(string), "~n~ You have parked your vehicle in this location. ~n~");

GameTextForPlayer(playerid, "You have parked your vehicle in this position. It will respawn here.", 10000, 3);

OnPropUpdate();

OnPlayerUpdateEx(playerid);

DestroyVehicle(carid);

CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);

TogglePlayerControllable(playerid, 1);

return 1;

  }

        }

                else

                {

                    SendClientMessage(playerid, COLOR_GREY, "  You have to sit at your own car to park it! ");

                    return 1;

  }

      }

            else

            {

                SendClientMessage(playerid, COLOR_GREY, "You can't park your car at the Dealership !");

                return 1;

}

        }

  [/pawn]

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

Salut. Uite aici o comanda care iti salveaza tuningul la masini:

	if (strcmp(cmd, "/savecar", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        new car;
	        if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { car = PlayerInfo[playerid][pPcarkey]; }
			else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { car = PlayerInfo[playerid][pPcarkey2]; }
			if (car != 9999)
			{
				if(IsPlayerInVehicle(playerid, car))
				{
				    new info[] = "Salveaza pozitia masinii \n Salveaza Tuningu la.. \n Salveaza tot tuningu \n Sterge tuningu la.. \n Sterge tot tuningu ";
					ShowPlayerDialog(playerid, 1300, DIALOG_STYLE_LIST,"Choose the Option",info,"Ok","Cancel");
					SendClientMessage(playerid, COLOR_PINK,"* To save the vehicle paintjob and colours use /v paintjob and /v color");
					SendClientMessage(playerid, COLOR_GRAD1, "* You are not in a setted car.");
				}
				else
				{
					SendClientMessage(playerid, COLOR_GRAD1, "* You are not in your vehicle!");
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "* You do not own a car!");
			}
		}
		return 1;
	}

Sa iti dea Deumnezeu sanatate TzAkS

Link to comment
Share on other sites

Salut. Uite aici o comanda care iti salveaza tuningul la masini:

	if (strcmp(cmd, "/savecar", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        new car;
	        if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { car = PlayerInfo[playerid][pPcarkey]; }
			else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { car = PlayerInfo[playerid][pPcarkey2]; }
			if (car != 9999)
			{
				if(IsPlayerInVehicle(playerid, car))
				{
				    new info[] = "Salveaza pozitia masinii \n Salveaza Tuningu la.. \n Salveaza tot tuningu \n Sterge tuningu la.. \n Sterge tot tuningu ";
					ShowPlayerDialog(playerid, 1300, DIALOG_STYLE_LIST,"Choose the Option",info,"Ok","Cancel");
					SendClientMessage(playerid, COLOR_PINK,"* To save the vehicle paintjob and colours use /v paintjob and /v color");
					SendClientMessage(playerid, COLOR_GRAD1, "* You are not in a setted car.");
				}
				else
				{
					SendClientMessage(playerid, COLOR_GRAD1, "* You are not in your vehicle!");
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "* You do not own a car!");
			}
		}
		return 1;
	}

Nu mai da copy din gm-uri aiurea.

Acea comanda foloseste multe functii,nu doar comanda salveaza tuningul.

Si daca te uiti putin in comanda ai si dialoguri..macar de i-o dadeai pe toata,dar nu stii ce sa cauti.

Uite aici

http://wiki.sa-mp.com/wiki/Saving_car_mods

gXvsYS
Link to comment
Share on other sites

Am incercat sa pun astea

http://wiki.sa-mp.com/wiki/Saving_car_mods

Dar imi da 5 erori

[pawn]D:\sv\gamemodes\GM.pwn(1739) : error 021: symbol already defined: "lights"

D:\sv\gamemodes\GM.pwn(1849) : warning 235: public function lacks forward declaration (symbol "SaveComponent")

D:\sv\gamemodes\GM.pwn(1853) : error 017: undefined symbol "PlInfo"

D:\sv\gamemodes\GM.pwn(1853) : warning 215: expression has no effect

D:\sv\gamemodes\GM.pwn(1853) : error 001: expected token: ";", but found "]"

D:\sv\gamemodes\GM.pwn(1853) : error 029: invalid expression, assumed zero

D:\sv\gamemodes\GM.pwn(1853) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

5 Errors.

[/pawn]

[pawn]

linai 1739

new engine,lights,alarm,doors,bonnet,boot,objective;

linia 1853

        if (strcmp(VehicleInfo[vehicleid][owner],PlInfo[playerid][name],false) == 0) {[/pawn]

Link to comment
Share on other sites

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.