Kill -1 score script (Rep +1) -
MichaelProPlayer - 07.04.2012
Can anybody make this script for me?? :
I cannot make score -1 code.Example: I have 104 score and i used /kill command then my score will set to 103
Can anybody help me please.
Re: Kill -1 score script (Rep +1) -
Jack.7331 - 07.04.2012
if (strcmp("/kill", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 0);
SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
}
Re: Kill -1 score script (Rep +1) -
MichaelProPlayer - 07.04.2012
Quote:
Originally Posted by Jack.7331
if (strcmp("/kill", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 0);
SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
}
|
Wow thanks.Can you help me with this too??
If a player name's is Michael and he used /kill then there will be a text message for all that Michael has commited a sucide.
Re: Kill -1 score script (Rep +1) -
Jack.7331 - 07.04.2012
Yep, will edit it in.
if (strcmp("/kill", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 0);
SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
new msg[128],
suicider[MAX_PLAYER_NAME];
GetPlayerName(playerid, suicider, sizeof suicider);
format(msg, sizeof(msg), "%s has commited suicide!", suicider);
SendClientMessageToAll(COLOR_RED, msg);
}
Re: Kill -1 score script (Rep +1) -
MichaelProPlayer - 07.04.2012
Quote:
Originally Posted by Jack.7331
Yep, will edit it in.
if (strcmp("/kill", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 0);
SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
new msg[128],
suicider[MAX_PLAYER_NAME];
GetPlayerName(playerid, suicider, sizeof suicider);
format(msg, sizeof(msg), "%s has commited suicide!", suicider);
SendClientMessageToAll(COLOR_RED, msg);
}
|
Ahh can you give me the code ??
Re: Kill -1 score script (Rep +1) -
spd_sahil - 07.04.2012
add this little thing - for clearing animations.. if you are doing an animation.. i.e swimming falling , etc.. it will be cleared..otherwise u might face bugs sometimes.. when that animation is on
pawn Код:
if (strcmp("/kill", cmdtext, true, 10) == 0)
{
ClearAnimations(playerid); // the change
SetPlayerHealth(playerid, 0);
SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
new msg[128],
suicider[MAX_PLAYER_NAME];
GetPlayerName(playerid, suicider, sizeof suicider);
format(msg, sizeof(msg), "%s has commited suicide!", suicider);
SendClientMessageToAll(COLOR_RED, msg);
}
Re: Kill -1 score script (Rep +1) -
MichaelProPlayer - 07.04.2012
Thank you both very much.And sorry for asking silly questions actually I am newbie in script.
Re: Kill -1 score script (Rep +1) -
Aira - 07.04.2012
Quote:
Originally Posted by MichaelProPlayer
Thank you both very much.And sorry for asking silly questions actually I am newbie in script.
|
There's no problem in asking questions here, its Free and Unlimited..
Were always here to help (Even if i was too late to see this -.- )
Re: Kill -1 score script (Rep +1) -
MichaelProPlayer - 07.04.2012
Quote:
Originally Posted by Aira
There's no problem in asking questions here, its Free and Unlimited..
Were always here to help (Even if i was too late to see this -.- )
|
lol ok
Re: Kill -1 score script (Rep +1) -
mariolatif741 - 14.01.2013
If you mean if you killed then you want to get -1 score then use this
at public OnPlayerDeath
use this
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerScore(playerid, -1);
SendClientMessage(playerid, 0xFF0000FF, "You have losed -1 score [Reason: You Are killed!]");
GameTextForPlayer(playerid, "-1 score [reason: you are killed!]", 30000, 6);
return 1;
}