pickup problem
#1

hey guys,
i made this kind of pickup and it is working fine but the thing is that when i chose a neoncolour from my dialog then the dialog dissapears(the car has neons then) but i want it that when the neons are on teh car the dialog appears again... and when u press cancel u will spawn at the place where the pickup is, this is my script:
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == neonpickup){
   	SetPlayerCameraPos(playerid, 2568.5808,786.4040,5.3158);
	SetPlayerCameraLookAt(playerid, 2561.8096,789.8107,5.3158);
	new veh = GetPlayerVehicleID(playerid);
	SetVehiclePos(veh, 2561.8096,789.8107,5.3158);
	SetVehicleZAngle(veh, 274.8242);
	LinkVehicleToInterior(veh, 0);
	SetVehicleVirtualWorld(veh, 0);
	PutPlayerInVehicle(playerid, veh, 0);
	ShowPlayerDialog(playerid, 8899, DIALOG_STYLE_LIST, "NeonShop", "Blue\nRed\nGreen\nWhite\nPink\nYellow\nPolice Strobe\nInterior Lights\nBack Neon\nFront neon\nUndercover Roof Light\nRemove All Neon", "Mount", "Cancel");
	PlayerPlaySound(playerid, 1133, 0.0, 0.0, 10.0);
	}
	return 1;
OnGameModeInit():
Код:
	neonpickup = CreatePickup(1274, 14, -2729.7417,74.0720,4.3359, -1);
Код:
// pickups
new neonpickup;
this is the place where i want it to spawn when u presses "cancel":
Код:
-2729.1545,83.5113,4.0694
the dialog response: (credits to [EDT]Quattro)
Код:
if ( dialogid == 8899 ) // commands
    {
        /* if second button pressed */
        if ( !response ) return SendClientMessage( playerid, -1, #You have canceled );
        /* if first button pressed */
        if ( response )
        {
            switch ( listitem )
            {
   			case 0:
			{


			//blue
			SetPVarInt(playerid, "Status", 1);
            SetPVarInt(playerid, "neon", CreateObject(18648,0,0,0,0,0,0));
            SetPVarInt(playerid, "neon1", CreateObject(18648,0,0,0,0,0,0));
            AttachObjectToVehicle(GetPVarInt(playerid, "neon"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
            AttachObjectToVehicle(GetPVarInt(playerid, "neon1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
   			 }
			case 1:
			{


			 //red
				SetPVarInt(playerid, "Status", 1);
	            SetPVarInt(playerid, "neon2", CreateObject(18647,0,0,0,0,0,0));
	            SetPVarInt(playerid, "neon3", CreateObject(18647,0,0,0,0,0,0));
	            AttachObjectToVehicle(GetPVarInt(playerid, "neon2"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
	            AttachObjectToVehicle(GetPVarInt(playerid, "neon3"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
	            SendClientMessage(playerid, 0xFFFFFFAA, "neon installed");

}
			case 2:
			{


			//green
		   	   SetPVarInt(playerid, "Status", 1);
       		   SetPVarInt(playerid, "neon4", CreateObject(18649,0,0,0,0,0,0));
               SetPVarInt(playerid, "neon5", CreateObject(18649,0,0,0,0,0,0));
               AttachObjectToVehicle(GetPVarInt(playerid, "neon4"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
               AttachObjectToVehicle(GetPVarInt(playerid, "neon5"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
               SendClientMessage(playerid, 0xFFFFFFAA, "neon installed");

	            }
			case 3:
			{

			//white
		   	   SetPVarInt(playerid, "Status", 1);
               SetPVarInt(playerid, "neon6", CreateObject(18652,0,0,0,0,0,0));
         	   SetPVarInt(playerid, "neon7", CreateObject(18652,0,0,0,0,0,0));
         	   AttachObjectToVehicle(GetPVarInt(playerid, "neon6"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
       		   AttachObjectToVehicle(GetPVarInt(playerid, "neon7"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
               SendClientMessage(playerid, 0xFFFFFFAA, "neon installed");

}
			case 4:
			{


			//pink
		   	   SetPVarInt(playerid, "Status", 1);
       		   SetPVarInt(playerid, "neon8", CreateObject(18651,0,0,0,0,0,0));
               SetPVarInt(playerid, "neon9", CreateObject(18651,0,0,0,0,0,0));
               AttachObjectToVehicle(GetPVarInt(playerid, "neon8"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
               AttachObjectToVehicle(GetPVarInt(playerid, "neon9"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
               SendClientMessage(playerid, 0xFFFFFFAA, "neon installed");

}
			case 5:
			{


			//yellow
		 		SetPVarInt(playerid, "Status", 1);
	            SetPVarInt(playerid, "neon10", CreateObject(18650,0,0,0,0,0,0));
	            SetPVarInt(playerid, "neon11", CreateObject(18650,0,0,0,0,0,0));
	            AttachObjectToVehicle(GetPVarInt(playerid, "neon10"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
	            AttachObjectToVehicle(GetPVarInt(playerid, "neon11"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
	            SendClientMessage(playerid, 0xFFFFFFAA, "neon installed");

}
			case 6:
			{


			//police
   	 		    SetPVarInt(playerid, "Status", 1);
	            SetPVarInt(playerid, "neon12", CreateObject(18646,0,0,0,0,0,0));
	            SetPVarInt(playerid, "neon13", CreateObject(18646,0,0,0,0,0,0));
	            AttachObjectToVehicle(GetPVarInt(playerid, "neon12"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
	            AttachObjectToVehicle(GetPVarInt(playerid, "neon13"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
	            SendClientMessage(playerid, 0xFFFFFFAA, "neon installed");

	            }

				case 7:
				{
	            SetPVarInt(playerid, "Status", 1);
	            SetPVarInt(playerid, "interior", CreateObject(18646,0,0,0,0,0,0));
	            SetPVarInt(playerid, "interior1", CreateObject(18646,0,0,0,0,0,0));
	            AttachObjectToVehicle(GetPVarInt(playerid, "interior"), GetPlayerVehicleID(playerid), 0, -0.0, 0, 2.0, 2.0, 3.0);
	            AttachObjectToVehicle(GetPVarInt(playerid, "interior1"), GetPlayerVehicleID(playerid), 0, -0.0, 0, 2.0, 2.0, 3.0);
	            SendClientMessage(playerid, 0xFFFFFFAA, "Interior lights installed");

	            }
           		case 8:
				{

				//back
	            SetPVarInt(playerid, "Status", 1);
	            SetPVarInt(playerid, "back", CreateObject(18646,0,0,0,0,0,0));
	            SetPVarInt(playerid, "back1", CreateObject(18646,0,0,0,0,0,0));
	            AttachObjectToVehicle(GetPVarInt(playerid, "back"), GetPlayerVehicleID(playerid), -0.0, -1.5, -1, 2.0, 2.0, 3.0);
	            AttachObjectToVehicle(GetPVarInt(playerid, "back1"), GetPlayerVehicleID(playerid), -0.0, -1.5, -1, 2.0, 2.0, 3.0);
	            SendClientMessage(playerid, 0xFFFFFFAA, "Back neon installed");
	            }
            	case 9:
				{

				//front
	            SetPVarInt(playerid, "Status", 1);
	            SetPVarInt(playerid, "front", CreateObject(18646,0,0,0,0,0,0));
	            SetPVarInt(playerid, "front1", CreateObject(18646,0,0,0,0,0,0));
	            AttachObjectToVehicle(GetPVarInt(playerid, "front"), GetPlayerVehicleID(playerid), -0.0, 1.5, -0.6, 2.0, 2.0, 3.0);
	            AttachObjectToVehicle(GetPVarInt(playerid, "front1"), GetPlayerVehicleID(playerid), -0.0, 1.5, -0.6, 2.0, 2.0, 3.0);
	            SendClientMessage(playerid, 0xFFFFFFAA, "Front neon installed");
	            }
	            case 10:
				{
	            //undercover
	            SetPVarInt(playerid, "Status", 1);
	            SetPVarInt(playerid, "undercover", CreateObject(18646,0,0,0,0,0,0));
	            SetPVarInt(playerid, "undercover1", CreateObject(18646,0,0,0,0,0,0));
	            AttachObjectToVehicle(GetPVarInt(playerid, "undercover"), GetPlayerVehicleID(playerid), -0.5, -0.2, 0.8, 2.0, 2.0, 3.0);
	            AttachObjectToVehicle(GetPVarInt(playerid, "undercover1"), GetPlayerVehicleID(playerid), -0.5, -0.2, 0.8, 2.0, 2.0, 3.0);
	            SendClientMessage(playerid, 0xFFFFFFAA, "Undercover lights installed");
	            }
			case 11:
			{
			//remove neon
            DestroyObject(GetPVarInt(playerid, "neon"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon1"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon2"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon3"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon4"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon5"));
			DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon6"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon7"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon8"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon9"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon10"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon11"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon12"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon13"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "interior"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "interior1"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "back"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "back1"));
            DeletePVar(playerid, "Status");
			DestroyObject(GetPVarInt(playerid, "front"));
			DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "front1"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "undercover"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "undercover1"));

            DeletePVar(playerid, "Status");


	 	      }
		 }
		 }
	    return 1;}
can someone help me?
Reply
#2

I don't know for sure, but you could try this...

Adding:
Код:
	ShowPlayerDialog(playerid, 8899, DIALOG_STYLE_LIST, "NeonShop", "Blue\nRed\nGreen\nWhite\nPink\nYellow\nPolice Strobe\nInterior Lights\nBack Neon\nFront neon\nUndercover Roof Light\nRemove All Neon", "Mount", "Cancel");
To all the Neon Color Cases

and for the cancel button

Change the !response to

Код:
        if ( !response ) return SetPlayerPos(playerid, -2729.1545,83.5113,4.0694);
Reply
#3

but eehm i want it that when the player presses cancel that the camera is on teh car again and not stays in teh garage... thats wut he is doing now... can u help me?

EDIT: and eehm how to make a text above my pickup? like "NeonShop"
Reply
#4

come on guys can anyone help me?
Reply
#5

Tried adding

Quote:

SetCameraBehindPlayer(playerid);

Under the "Cancel" Button functions?


+Rep if it works
Reply
#6

yeah it works thnx man maybe i'll come with another question but for now it's OK thnx man REP+ bro XD
Reply
#7

ok i got new question XD: how to make a text above my pickup? i want above it "NeonShop" can u help me?
Reply
#8

Код:
new Text:neon;

public OnGameModeInit()
{
    neon = TextDrawCreate(240.0,580.0,"Neon Shop");
    return 1;
}

public OnPlayerConnect(playerid)
{
    
    TextDrawShowForPlayer(playerid,neon);
}
Something similar to that
Reply
#9

okay havent tested yet but thnx bro i go test it tomorrow
Reply
#10

No problem man.. I'm farming just.. Farming rep + I know how it is to be a noob (I'm still one) -But the part where no one helps you, so I'll try helping questions here :3

You can also just send me a PM if you need help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)