PDA

View Full Version : How to use /spree (rep++)


iOmar
28/04/2012, 03:58 PM
Guys i have killing spree system. I want that when player type /spree than it will show that: "you are on spree of 1 or 2 or his kill before he died. As player died all /spree will gone.. Please help me..

Mark Shade
28/04/2012, 04:01 PM
Send me forum pm of ur servers ip ill help u out

iOmar
28/04/2012, 05:09 PM
my server is not hosted yet...

Rudy_
28/04/2012, 05:18 PM
COMMAND:spree(playerid, params[])
{
if(KillingSpree[playerid] = 0) return SendClientMessage(playerid, -1, "You are not on Killing spree");
if(KillingSpree[playerid] = 3) return SendClientMessage(playerid, -1, "You are on killing spree of 3 kills");
if(KillingSpree[playerid] = 6) return SendClientMessage(playerid, -1, "You are on killing spree of 6 Kills");
// And more..
return 1;
}
Btw, you need new KillingSpree[MAX_PLAYERS]; On Top..

zSuYaNw
28/04/2012, 05:22 PM
COMMAND:spree(playerid, params[])
{
if(KillingSpree[playerid] = 0; return SendClientMessage(playerid, -1, "You are not on Killing spree");
if(KillingSpree[playerid] = 3; return SendClientMessage(playerid, -1, "You are on killing spree of 3 kills");
if(KillingSpree[playerid] = 6; return SendClientMessage(playerid, -1, "You are on killing spree of 6 Kills");
// And more..
return 1;
}
Btw, you need new KillingSpree[MAX_PLAYERS]; On Top..

Error,

COMMAND:spree(playerid, params[])
{
if(KillingSpree[playerid] = 0) return SendClientMessage(playerid, -1, "You are not on Killing spree");
if(KillingSpree[playerid] = 3) return SendClientMessage(playerid, -1, "You are on killing spree of 3 kills");
if(KillingSpree[playerid] = 6) return SendClientMessage(playerid, -1, "You are on killing spree of 6 Kills");
// And more..
return 1;
}

Rudy_
28/04/2012, 05:23 PM
Mhm.. yea i forgot ")"

ReVo_
28/04/2012, 05:28 PM
COMMAND:spree(playerid, params[])
{
if(KillingSpree[playerid] == 0) return SendClientMessage(playerid, -1, "You are not on Killing spree");
if(KillingSpree[playerid] == 3) return SendClientMessage(playerid, -1, "You are on killing spree of 3 kills");
if(KillingSpree[playerid] == 6) return SendClientMessage(playerid, -1, "You are on killing spree of 6 Kills");
// And more..
return 1;
}


==

Mean
28/04/2012, 05:29 PM
strcmp, really easy to convert to zcmd:

// On top of the script:
new gpSpree[MAX_PLAYERS];

// OnPlayerCommandText code:
if(!strcmp(cmdtext, "/spree", true, 6)) {
new str[55];
format(str, sizeof str, "You're currently on a killing spree of %d kills.", gpSpree[playerid]);
SendClientMessage(playerid, -1, str);
return 1;
}

// OnPlayerConnect code:
gpSpree[playerid] = 0;

// OnPlayerDeath code:
gpSpree[playerid] = 0;
gpSpree[killerid]++;