#1

how can i do that when i write a commnand... like /hi it will make another command?
exemple:
if i write in game:
/giveweapon 1 38 99999 - it will make the minigun in this spot(i know how to do this...) and make a new command that if you will write /mini the results will be the same(but if you wont write the /giveweapon first... there won't be a mini command) so i what i want to ask is how can i make commands while i am in a server...
Reply
#2

what u mean ?
Reply
#3

Quote:
Originally Posted by wheelman_WM
Посмотреть сообщение
what u mean ?
added an explanation
Reply
#4

Post here your /giveweapon command... if there's one
Reply
#5

Код:
if (strcmp("/mini", cmdtext, true) == 0)
		{
		SetPlayerPos(playerid, 190.8881,-1802.1117,4.2210);
		GivePlayerWeapon(playerid, 38, 500);
  new name[MAX_PLAYER_NAME];
    new msg[256];
	GetPlayerName(playerid,name,MAX_PLAYER_NAME);
	format(msg,sizeof(msg),"%s [%i] has use /mini cmd to get minigun bal bla.",name,playerid);
	SendClientMessageToAll(COLOR_GREEN,msg);
        return 1;
}
Reply
#6

you didnt understand! how can i do that if i write:
/command lv
it will create a command that if you write /lv
you will teleport to the place you wrote the command... so basicly i want to know how can i create a new command by using another command in game!
Reply
#7

pawn Код:
if(strcmp(cmdtext, "/ONECOMMAND", true) == 0 || strcmp(cmdtext, "/TWOCOMMAND", true) == 0)
{
//Your function HERE
}
That's what you want?
Reply
#8

Quote:
Originally Posted by Vukilore
Посмотреть сообщение
pawn Код:
if(strcmp(cmdtext, "/ONECOMMAND", true) == 0 || strcmp(cmdtext, "/TWOCOMMAND", true) == 0)
{
//Your function HERE
}
That's what you want?
no... i want to create a command that if i use it in game it will create another command
Reply
#9

Well, if I`m not wrong, I think I know what you want. Well, for that, you need to make a global variable, like:
pawn Код:
new minigun[MAX_PLAYERS];
And now, in the commands do like:
pawn Код:
CMD:giveweapon(playerid, params[])
{
//bla bla bla
     minigun[playerid] = 1;
And for the other command like:
pawn Код:
CMD:minigun(playerid, params[])
{
     if(minigun[playerid] == 0)
          return SendClientMessage(playerid, -1, "Use /giveweapon first.");

    //the rest of the code here, what do you want it to do.
    minigun[playerid] = 0;
}
Basically, what this will do: /giveweapon will set the 'minigun' variable to 1 for the player who uses the command. To use the /minigun command, you`ll need to have the 'minigun' variable to 1. Else, it`ll do nothing. Is that what you wanted? Oh and don`t forget, to set the variable to 0 when he uses the command ... that`s only if you want.
Reply
#10

Quote:
Originally Posted by antonio112
Посмотреть сообщение
Well, if I`m not wrong, I think I know what you want. Well, for that, you need to make a global variable, like:
pawn Код:
new minigun[MAX_PLAYERS];
And now, in the commands do like:
pawn Код:
CMD:giveweapon(playerid, params[])
{
//bla bla bla
     minigun[playerid] = 1;
And for the other command like:
pawn Код:
CMD:minigun(playerid, params[])
{
     if(minigun[playerid] == 0)
          return SendClientMessage(playerid, -1, "Use /giveweapon first.");

    //the rest of the code here, what do you want it to do.
    minigun[playerid] = 0;
}
Basically, what this will do: /giveweapon will set the 'minigun' variable to 1 for the player who uses the command. To use the /minigun command, you`ll need to have the 'minigun' variable to 1. Else, it`ll do nothing. Is that what you wanted? Oh and don`t forget, to set the variable to 0 when he uses the command ... that`s only if you want.
that's not what i meant... i will tell you what i wanted to do...
if i will write /teleportsave NAME it will create a command (/NAME) and the command will teleport the player to the place he wrote the /teleportsave... so it basiclly how to create a command while in game
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)