help with a command -
SwatOwner - 06.07.2011
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
Re: help with a command -
Shadoww5 - 06.07.2011
You just need to change the coordinates (
X, Y, Z ):
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/map", true) == 0)
{
ShowPlayerDialog(playerid, 123, DIALOG_STYLE_LIST, "Where do you want to go ?", "Beach\nMall\nAirport\nCity Hall", "Choose", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 123)
{
if(response)
{
if(listitem == 0)
{
SetPlayerCheckpoint(playerid, X, Y, Z, 8.0);
SendClientMessage(playerid, 0xFFFF00FF, "GPS: Beach.");
}
else if(listitem == 1)
{
SetPlayerCheckpoint(playerid, X, Y, Z, 8.0);
SendClientMessage(playerid, 0xFFFF00FF, "GPS: Mall.");
}
else if(listitem == 2)
{
SetPlayerCheckpoint(playerid, X, Y, Z, 8.0);
SendClientMessage(playerid, 0xFFFF00FF, "GPS: Airport.");
}
else if(listitem == 3)
{
SetPlayerCheckpoint(playerid, X, Y, Z, 8.0);
SendClientMessage(playerid, 0xFFFF00FF, "GPS: City Hall.");
}
}
}
return 1;
}
Re: help with a command -
Jochemd - 06.07.2011
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 :/
Re: help with a command -
SwatOwner - 06.07.2011
Omg omg ...really thanks too both for really ffs fast reply
Re: help with a command -
Jochemd - 06.07.2011
You're welcome.
Re: help with a command -
SwatOwner - 06.07.2011
erg now found its not working :S
can any one help with teamviewer ?
Re: help with a command -
SwatOwner - 09.07.2011
really sad to say ..Bump
Re: help with a command -
Kush - 09.07.2011
What is not working? Post what errors you have received and this can be resolved in no time.
Re: help with a command -
SwatOwner - 09.07.2011
thanks shawdow for the code and kush for implementing it

and make it working