16.04.2013, 12:52
I want a menu to open up when I enter a checkpoint, cant get it to work for some reason.
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
}
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
2022.2019,1007.7247,10.8203 //If i remember correctly, this is outside the 4 Dragons LV.
#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;
}
new Test2;
public OnGameModeInit()
test2 = CreatePickup(pickupid,type,x,y,z,virtualworld); //reccomend at -1 for allworlds
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == test2)
ShowPlayerDialog(playerid, DIALOG_WELCOME, DIALOG_STYLE_MSGBOX, "Congratulations", "Your pickup works", "Close", "");
return 1;
}
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;
}