one thing with 2 commands - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: one thing with 2 commands (
/showthread.php?tid=243942)
one thing with 2 commands -
wheelman_WM - 25.03.2011
Код:
if (strcmp("/teleports", cmdtext, true, 10) == 0)
Hey i want that when players use /t than the samp dialog will appear as in /teleports
Re: one thing with 2 commands -
Jochemd - 25.03.2011
pawn Код:
if (strcmp("/t", cmdtext, true, 10) == 0)
{
OnPlayerCommandText(playerid, "/teleports");
return 1;
}
Will call OnPlayerCommandText with the command "/teleports"
Re: one thing with 2 commands -
wheelman_WM - 25.03.2011
still unknown command
Re: one thing with 2 commands -
Jochemd - 25.03.2011
Do you have /teleport in your script? I mean so you don't have only the command I gave you
Re: one thing with 2 commands -
wheelman_WM - 25.03.2011
yeah
Re: one thing with 2 commands -
wheelman_WM - 25.03.2011
Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
if (strcmp("/teleports", cmdtext, true, 10) == 0)
{
dm1[playerid]=1;
ShowPlayerDialog(playerid,dm,DIALOG_STYLE_LIST,"Teleports Menu","Las Venturas\nLos Santos\nSan Fiero\nDive From Sky\nLos Santos Airport\nLas Venturas Airport\nAbandoned Airport","Select","Cancel");
return 1;
}
if(dm1[playerid] == 1)
if(!strcmp(cmdtext,"",true)) {
return 1;
}
return 0;
}
here it is

i edited a dm script and maded its teleport menu see
Re: one thing with 2 commands -
Jakku - 25.03.2011
pawn Код:
if(strcmp(cmd, "/teleports", true)==0 || strcmp(cmd, "/t", true)==0)
{
//Stuff here
return 1;
}
Re: one thing with 2 commands -
wheelman_WM - 25.03.2011
tthnx topic locky locky
Re: one thing with 2 commands -
Biesmen - 25.03.2011
Quote:
Originally Posted by Jochemd
pawn Код:
if (strcmp("/t", cmdtext, true, 10) == 0) { OnPlayerCommandText(playerid, "/teleports"); return 1; }
Will call OnPlayerCommandText with the command "/teleports"
|
Do you know how to use strcmp in this case?
You're saying the command /t contains 10 characters.