Command /setkills how i should make it? - 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: Command /setkills how i should make it? (
/showthread.php?tid=622081)
Command /setkills how i should make it? -
henkas - 18.11.2016
Hello i need your help wery fast how i need create simple command which give me one frag or more. I Need it for test
me variable "pKills"
Re: Command /setkills how i should make it? - iLearner - 18.11.2016
on code no help.
Re: Command /setkills how i should make it? -
henkas - 18.11.2016
Quote:
Originally Posted by iLearner
on code no help.
|
Seriously?
Re: Command /setkills how i should make it? -
Dayrion - 18.11.2016
It's not request script section.
Show your code and we should able to help you.
Re: Command /setkills how i should make it? -
henkas - 18.11.2016
Well ignore this post. I will call me friend for test.
Re: Command /setkills how i should make it? -
Sew_Sumi - 18.11.2016
Quote:
Originally Posted by henkas
Well ignore this post. I will call me friend for test.
|
Would've thought that such a simple command setup would've been learnt over a year, and 150+ posts...
Learn to script, I'd have thought that someone would've told you that in all your time of requesting code...
Re: Command /setkills how i should make it? -
TwinkiDaBoss - 18.11.2016
Example code, learn from this so in the future when you need help, post the problem you have with the code that you currently have otherwise dont expect help.
pawn Код:
enum P_DATA {
pKills,
pDeaths
}
new pInfo[MAX_PLAYERS][P_DATA]; /* Hooking pInfo to player and some P_DATA so we can use pInfo[playerid][pKills] += 1; etc. */
public OnPlayerDeath(playerid, killerid, reason)
{
pInfo[playerid][pDeaths] += 1; //adding 1 death to players deaths
if(killerid != INVALID_PLAYER_ID) { //if the killer exists, making sure player didnt die by falling, admin killed etc.
pInfo[killerid][pKills] += 1; //adding 1 more kill to the killer
new string[64];
format(string,sizeof(string),"You have %i kills in total",pInfo[killerid][pKills]);
SendClientMessage(killerid,COLOR_GREEN,string);
}
return 1;
}
CMD:addkills(playerid,params[]) {
new kills;
if(sscanf(params,"i",kills)) return SendClientMessage(playerid,COLOR_RED,"Usage: /addkills [kills]");
pInfo[playerid][pKills] += kills; //adds to current kills
return true;
}