SA-MP Forums Archive
Help with command - 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)
+--- Thread: Help with command (/showthread.php?tid=499602)



Help with command - TheLastShadow - 08.03.2014

I want a command /startbattle . When i write this command, save my position. And when people write /joinbattle get him at my save coordonate. and give him knife.


Re: Help with command - Dipto - 08.03.2014

So, is startbattle is just for admin


Re: Help with command - Abagail - 08.03.2014

Код:
new,
BattleJoin = 999,
BattleX[MAX_PLAYERS],
BattleY[MAX_PLAYERS],
BattleZ[MAX_PLAYERS];

CMD:startbattle(playerid, params[])
{
BattleJoin = playerid;
new Float: x, Float: y, Float: z;
GetPlayerPos(playerid, x, y, z);
BattleX[playerid] = x;
BattleY[playerid] = y;
BattleZ[playerid] = z;
}

CMD:joinbattle(playerid, params[])
{
if(BattleJoin == 999) return 0;
new giveplayerid = BattleJoin;
SetPlayerPos(playerid, BattleX[giveplayerid], BattleY[giveplayerid], BattleZ[giveplayerid];
GivePlayerWeapon(playerid, 4, 99999);
}

Untested.



Re: Help with command - Dipto - 08.03.2014

Quote:
Originally Posted by Abagail
Посмотреть сообщение
Код:
new,
BattleJoin = 999,
BattleX[MAX_PLAYERS],
BattleY[MAX_PLAYERS],
BattleZ[MAX_PLAYERS];

CMD:startbattle(playerid, params[])
{
BattleJoin = playerid;
new Float: x, Float: y, Float: z;
GetPlayerPos(playerid, x, y, z);
BattleX[playerid] = x;
BattleY[playerid] = y;
BattleZ[playerid] = z;
}

CMD:joinbattle(playerid, params[])
{
if(BattleJoin == 999) return 0;
new giveplayerid = BattleJoin;
SetPlayerPos(playerid, BattleX[giveplayerid], BattleY[giveplayerid], BattleZ[giveplayerid];
GivePlayerWeapon(playerid, 4, 99999);
}

Untested.
i liked this one


Re: Help with command - TheLastShadow - 09.03.2014

Ok i will test. I will be back with edit

EDIT: Don't work ... make in if(strcmp ... ) is easier for me with strcmp.


Re: Help with command - TheLastShadow - 09.03.2014

Don't work ... make in if(strcmp ... ) is easier for me with strcmp.