Hitmen 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)
+--- Thread: Hitmen commands? (
/showthread.php?tid=339408)
Hitmen commands? -
BleverCastard - 03.05.2012
I have no idea on how to do hitmen commands like
/givehit [targetid] [id]
/takehit [id]
and when you kill someone it gives you the money.
HELP?
Re: Hitmen commands? -
Accord - 03.05.2012
what do you mean in "hitemen", you want if someone did the command /givehit 0[id] 500[money] and after that someone killed the id 0 so he will get the money?
Re: Hitmen commands? -
BleverCastard - 03.05.2012
Yes.
Re: Hitmen commands? -
dannyk0ed - 03.05.2012
Do you have a hitman faction?
Re: Hitmen commands? -
BleverCastard - 03.05.2012
Yes, I just need the commands.
Re: Hitmen commands? -
Accord - 03.05.2012
If you want it without a variable you can use this:
Код:
if(!strcmp(cmd,"/givehit",true))
{
new
ID[256],
Amount[256]
;
ID = strtok(cmdtext, idx);
Amount = strtok(cmdtext, idx);
if(!strlen(ID) && !strlen(Amount) && !IsPlayerConnected(strval(ID))) return SendClientMessage(playerid, -1, !IsPlayerConnected(strval(ID))? ("This player not connected") : ("You need to write playerid and amount."));
if(GetPlayerMoney(playerid) < strval(Amount)) return SendClientMessage(playerid, -1, "Invalid amount.");
return GivePlayerMoney(playerid, -strval(Amount)), GivePlayerMoney(strval(ID), strval(Amount));
}
Re: Hitmen commands? -
dannyk0ed - 03.05.2012
Its RP right?
Re: Hitmen commands? -
BleverCastard - 03.05.2012
Quote:
Originally Posted by Accord
If you want it without a variable you can use this:
Код:
if(!strcmp(cmd,"/givehit",true))
{
new
ID[256],
Amount[256]
;
ID = strtok(cmdtext, idx);
Amount = strtok(cmdtext, idx);
if(!strlen(ID) && !strlen(Amount) && !IsPlayerConnected(strval(ID))) return SendClientMessage(playerid, -1, !IsPlayerConnected(strval(ID))? ("This player not connected") : ("You need to write playerid and amount."));
if(GetPlayerMoney(playerid) < strval(Amount)) return SendClientMessage(playerid, -1, "Invalid amount.");
return GivePlayerMoney(playerid, -strval(Amount)), GivePlayerMoney(strval(ID), strval(Amount));
}
|
This is not useful to me, I use zcmd.
Quote:
Originally Posted by dannyk0ed
Its RP right?
|
Yes..
Re: Hitmen commands? -
Accord - 03.05.2012
You can change it, you know..
Re: Hitmen commands? -
BleverCastard - 03.05.2012
Quote:
Originally Posted by Accord
You can change it, you know..
|
This will not work.