Teleport to event location CMD/DIALOG
#1

Hello guys,so I want to make a command when you type /event it shows you a dialog with locations (event1,2,3,4 etc.) and when you click a location it teleports you to the location.Any ideas,its sounds simple :P Tnx in advance who helps.
Reply
#2

umm you got the event locations (positions XYZ(and interior ids if an interior))??
Reply
#3

PHP код:
CMD:event(playerid,params[])
{
    
ShowPlayerDialog(playerid,7323,DIALOG_STYLE_LIST"Event Locations","Event Location 1/nEvent Location 2/nEvent Location 3/nEvent Location 4""Select""Close");
}
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 7323)
    {
        if(
response)
        {
            switch(
listitem)
            {
                case 
0:SetPlayerPos(playeridxyz);
                case 
1:SetPlayerPos(playeridxyz);
                case 
2:SetPlayerPos(playeridxyz);
                case 
3:SetPlayerPos(playeridxyz);
            }
        }
        return 
1;
    }
    return 
0;

Replace x,y,z with your event location coordinates
Reply
#4

Locations (there are no interiors)
X l Y l Z

-710.97, 1914.67, 1.16
-302.17, 1511.51, 75.35
-1656.94, -164.41, 14.14
1523.43, -1088.98, 181.20
Reply
#5

Thanks
Reply
#6

Quote:
Originally Posted by xTURBOx
Посмотреть сообщение
PHP код:
CMD:event(playerid,params[])
{
    
ShowPlayerDialog(playerid,7323,DIALOG_STYLE_LIST"Event Locations","Event Location 1/nEvent Location 2/nEvent Location 3/nEvent Location 4""Select""Close");
}
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 7323)
    {
        if(
response)
        {
            switch(
listitem)
            {
                case 
0:SetPlayerPos(playeridxyz);
                case 
1:SetPlayerPos(playeridxyz);
                case 
2:SetPlayerPos(playeridxyz);
                case 
3:SetPlayerPos(playeridxyz);
            }
        }
        return 
1;
    }
    return 
0;

Replace x,y,z with your event location coordinates
The code works,but how to fix this error?
Код:
C:\Users\Nexy\Desktop\Yugoslavia Trucking v.0.3.7\Yugoslavia Trucking v.0.3.7\gamemodes\YT.pwn(1979) : error 021: symbol already defined: "JBC_OnDialogResponse"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#7

Quote:
Originally Posted by NexySamp
Посмотреть сообщение
The code works,but how to fix this error?
Код:
C:\Users\Nexy\Desktop\Yugoslavia Trucking v.0.3.7\Yugoslavia Trucking v.0.3.7\gamemodes\YT.pwn(1979) : error 021: symbol already defined: "JBC_OnDialogResponse"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Can you show your includes used in the script?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)