help -
omer5198 - 12.04.2011
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...
Re: help -
wheelman_WM - 12.04.2011
what u mean ?
Re: help -
omer5198 - 12.04.2011
Quote:
Originally Posted by wheelman_WM
what u mean ?
|
added an explanation
Re: help -
Alby Fire - 12.04.2011
Post here your /giveweapon command... if there's one
Re: help -
wheelman_WM - 12.04.2011
Код:
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;
}
Re: help -
omer5198 - 12.04.2011
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!
Re : help -
Vukilore - 12.04.2011
pawn Код:
if(strcmp(cmdtext, "/ONECOMMAND", true) == 0 || strcmp(cmdtext, "/TWOCOMMAND", true) == 0)
{
//Your function HERE
}
That's what you want?
Re: Re : help -
omer5198 - 12.04.2011
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
Re: help -
antonio112 - 12.04.2011
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.
Re: help -
omer5198 - 12.04.2011
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