SA-MP Forums Archive
Teleport to event location CMD/DIALOG - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Teleport to event location CMD/DIALOG (/showthread.php?tid=590723)



Teleport to event location CMD/DIALOG - NexySamp - 03.10.2015

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.


Re: Teleport to event location CMD/DIALOG - xTURBOx - 03.10.2015

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


Re: Teleport to event location CMD/DIALOG - xTURBOx - 03.10.2015

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


Re: Teleport to event location CMD/DIALOG - NexySamp - 03.10.2015

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


Re: Teleport to event location CMD/DIALOG - NexySamp - 03.10.2015

Thanks


Re: Teleport to event location CMD/DIALOG - NexySamp - 03.10.2015

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.



Re: Teleport to event location CMD/DIALOG - xTURBOx - 05.10.2015

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?