help with a command
#1

hello guys i know its silly but i am getting errors with it..

i want to make a command /map

so when i type /map there comes a dialog and list of places when i click on one place a red checkpoint comes to that point if someone could make the code i will be happy for that
Reply
#2

You just need to change the coordinates ( X, Y, Z ):

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmdtext"/map"true) == 0)
    {
        
ShowPlayerDialog(playerid123DIALOG_STYLE_LIST"Where do you want to go ?""Beach\nMall\nAirport\nCity Hall""Choose""Cancel");
        return 
1;
    }
    return 
0;
}

public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 123)
    {
        if(
response)
        {
            if(
listitem == 0
            { 
                
SetPlayerCheckpoint(playeridXYZ8.0);
                
SendClientMessage(playerid0xFFFF00FF"GPS: Beach."); 
            }
            else if(
listitem == 1
            { 
                
SetPlayerCheckpoint(playeridXYZ8.0);
                
SendClientMessage(playerid0xFFFF00FF"GPS: Mall.");
            }
            else if(
listitem == 2)
            { 
                
SetPlayerCheckpoint(playeridXYZ8.0);
                
SendClientMessage(playerid0xFFFF00FF"GPS: Airport.");
            }
            else if(
listitem == 3
            { 
                
SetPlayerCheckpoint(playeridXYZ8.0);
                
SendClientMessage(playerid0xFFFF00FF"GPS: City Hall.");
            }
        }
    }
    return 
1;

Reply
#3

Just save a few places, when a player presses that list item -> SetPlayerCheckpoint.

This can't be simpler.. But ok, here's a little code

pawn Код:
#define DIALOG_MAP // Put this on top of script

public OnPlayerCommandText(playerid,cmdtext[])
{
    if(!strcmp(cmdtext,"/map",true))
    {
        ShowPlayerDialog(playerid,DIALOG_MAP,DIALOG_STYLE_LIST,"Map","Center of map","Select","Quit");
        return 1;
    }
    return 0;
}

public OnDialogResponse(playerid,dialogid,response,lisitem,inputtext[])
{
    if(dialogid == DIALOG_MAP)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    SendClientMessage(playerid,-1,"You have set a dot at 'Center of map'");
                    SetPlayerCheckpoint(playerid,0.0,0.0,3.0,5);
                }
                /*case 1:
                {
                    blah
                } */

            }
        }
    }
    return 1;
}
Edit: Shadows are always faster :/
Reply
#4

Omg omg ...really thanks too both for really ffs fast reply
Reply
#5

You're welcome.
Reply
#6

erg now found its not working :S

can any one help with teamviewer ?
Reply
#7

really sad to say ..Bump
Reply
#8

What is not working? Post what errors you have received and this can be resolved in no time.
Reply
#9

thanks shawdow for the code and kush for implementing it and make it working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)