Menu when entering checkpoint -
BossZk - 16.04.2013
I want a menu to open up when I enter a checkpoint, cant get it to work for some reason.
Re: Menu when entering checkpoint -
DobbysGamertag - 16.04.2013
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
ShowPlayerDialog(playerid, the dialog id here, DIALOG_STYLE_LIST, "titlehere", "whatever you want in your menu", "button 1", "button 2");
return 1; // not knowing what menu you want to pop up. I cant help you much
}
Re: Menu when entering checkpoint -
BossZk - 16.04.2013
Quote:
Originally Posted by DobbysGamertag
pawn Код:
public OnPlayerEnterCheckpoint(playerid) { ShowPlayerDialog(playerid, the dialog id here, DIALOG_STYLE_LIST, "titlehere", "whatever you want in your menu", "button 1", "button 2"); return 1; // not knowing what menu you want to pop up. I cant help you much }
|
A menu like this, and if i could give you the position of where i want the checkpoint could you help me place it? and i'll be having multiple checkpoints, so wouldn't OnPlayerEnterCheckpoint, make that dialog come up on every checkpoint?
HELP pls
Re: Menu when entering checkpoint -
DobbysGamertag - 18.04.2013
Im not too sure about the multiple checkpoint thing, i use normal checkpoints for my missions and thats it. You could try using Pickups? and i could show you how to do it
pawn Код:
AddPlayerClass(6,2022.2019,1007.7247,10.8203,266.9470,0,0,0,0,0,0);
6 //skin id (not important in placing markers/checkpoints etc
2022.2019 // X coordinates for placing the markers/checkpoints
1007.7247 // Y coordinates for placing
10.8203 // Z coordinates for placing
The bit you'll want for placing is the XYZ. So from the example you'll take:
pawn Код:
2022.2019,1007.7247,10.8203 //If i remember correctly, this is outside the 4 Dragons LV.
That's all it is to it placing checkpoints. However, if you want to use pickups that's a whole different story
i can show you that method though if you like?
Re: Menu when entering checkpoint -
Guest123 - 18.04.2013
can you give me that script ?
Re: Menu when entering checkpoint -
DobbysGamertag - 19.04.2013
Script? which one?
Re: Menu when entering checkpoint -
BossZk - 20.04.2013
Yeah sure if you could show me that with pickups that would be fine
Re: Menu when entering checkpoint -
DobbysGamertag - 20.04.2013
I reccomend using
http://codegenerators.pl/infotext for making the pickups
i know it says info text. But thats how i make the pickups to trigger dialogs. Just change the onplayerpickuppickup to show your dialog ID you'd like to show.
pawn Код:
#include <a_samp>
new test; //declare them as "new" each time you add a new pickup
public OnGameModeInit()
{
test = CreatePickup(3433, 1, 2084.4717, -1808.0403, 13.3828, -1);//create the pickup. Make unique names i find is easier to identify
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == test)
//here goes your show player dialog
return 1;
}
to get the next one you simple /save. get the x y z
go to the FS/GM add
pawn Код:
new Test2;
public OnGameModeInit()
test2 = CreatePickup(pickupid,type,x,y,z,virtualworld); //reccomend at -1 for allworlds
So there's the pickups created. but you want to show them in a car correct? that will be:
"14 -Pickupable, but only when in a vehicle." (samp wiki)
Now you want to make something happen when you drive over the pickup.
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == test2)
ShowPlayerDialog(playerid, DIALOG_WELCOME, DIALOG_STYLE_MSGBOX, "Congratulations", "Your pickup works", "Close", "");
return 1;
}
Now im gonna add it all into one for you
hopefully you're following my awful explanation.
pawn Код:
new infotext;
new blabla;
public OnGameModeInit()
{
infotext = CreatePickup(1241,14, 2084.4717, -1808.0403, 13.3828, -1); //random saveplace i had
blabla = CreatePickup(1241,14,2157.8694, -1798.4272, 13.3671, -1); //another random :)
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == test)
ShowPlayerDialog(playerid, DIALOG_WELCOME, DIALOG_STYLE_MSGBOX, "Hello", "You can add your dialogs here", "Close", "");
if(pickupid == blabla)
ShowPlayerDialog(playerid,yours can go here.);
return 1;
}
Let me know if you need it explaining
Re: Menu when entering checkpoint -
BossZk - 23.04.2013
Yes i understand but how do i make it so when a dialog opens when people pick an option they get it, for example i just put a weapons name 'tech-9' in the dialog, how would i make it so they actually get the tech 9 when they click on it
Re: Menu when entering checkpoint -
DaTa[X] - 23.04.2013
use strfind(inputtext)