one thing with 2 commands
#1

Код:
if (strcmp("/teleports", cmdtext, true, 10) == 0)
Hey i want that when players use /t than the samp dialog will appear as in /teleports
Reply
#2

pawn Код:
if (strcmp("/t", cmdtext, true, 10) == 0)
{
    OnPlayerCommandText(playerid, "/teleports");
    return 1;
}
Will call OnPlayerCommandText with the command "/teleports"
Reply
#3

still unknown command
Reply
#4

Do you have /teleport in your script? I mean so you don't have only the command I gave you
Reply
#5

yeah
Reply
#6

Код:
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
Reply
#7

pawn Код:
if(strcmp(cmd, "/teleports", true)==0 || strcmp(cmd, "/t", true)==0)
{
//Stuff here
return 1;
}
Reply
#8

tthnx topic locky locky
Reply
#9

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)