Kill -1 score script (Rep +1)
#1

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.
Reply
#2

if (strcmp("/kill", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 0);
SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
}
Reply
#3

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.
Reply
#4

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);
}
Reply
#5

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 ??
Reply
#6

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);
}
Reply
#7

Thank you both very much.And sorry for asking silly questions actually I am newbie in script.
Reply
#8

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 -.- )
Reply
#9

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
Reply
#10

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)