1
Snippet Showroom / Re: Spree System By SaFeeR
« on: October 29, 2012, 02:08:21 pm »
did u like it ?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
new Rampage[MAX_PLAYERS];
Rampage[playerid] = 0;
IncPlayerWanted(killerid, 1);
SetPlayerWanted(playerid,0);
new str[256];
Rampage[playerid] = 0;
Rampage[killerid]++;
if(Rampage[killerid] == 5) {
GetPlayerName(killerid, str, sizeof(str) );
format(str, sizeof(str), "%s has %d kills in a row!", str, Rampage[killerid] );
SendClientMessageToAll(RED, str);
SendClientMessage(killerid, RED, "Spree Killing: You have been given $5000!");
GameTextForPlayer(killerid,"~p~Spree Killing");
GivePlayerMoney(killerid,5000);
SetWantedLevel(killerid,5);
}
else if(Rampage[killerid] == 10) {
GetPlayerName(killerid, str, sizeof(str) );
format(str, sizeof(str), "%s has %d kills in a row!", str, Rampage[killerid] );
SendClientMessageToAll(RED, str);
SendClientMessage(killerid, RED, "Spree Killing: You have been given $10000!");
GameTextForPlayer(killerid,"~p~Spree Killing");
GivePlayerMoney(killerid,10000);
SetWantedLevel(killerid,10);
}
else if(Rampage[killerid] == 15){
GetPlayerName(killerid, str, sizeof(str) );
format(str, sizeof(str), "%s has %d kills in a row!", str, Rampage[killerid] );
SendClientMessageToAll(RED, str);
SendClientMessage(killerid, RED, "Spree Killing: You have been given $15000!");
GameTextForPlayer(killerid,"~p~Spree Killing");
GivePlayerMoney(killerid,15000);
SetWantedLevel(killerid,15);
}
else if(Rampage[killerid] == 20){
GetPlayerName(killerid, str, sizeof(str) );
format(str, sizeof(str), "%s has %d kills in a row!", str, Rampage[killerid] );
SendClientMessageToAll(RED, str);
SendClientMessage(killerid, RED, "Spree Killing: You have been given $200000!");
GameTextForPlayer(killerid,"~p~Spree Killing");
GivePlayerMoney(killerid,20000);
SetWantedLevel(killerid,20);
}
else if(Rampage[killerid] == 25){
GetPlayerName(killerid, str, sizeof(str) );
format(str, sizeof(str), "%s has %d kills in a row!", str, Rampage[killerid] );
SendClientMessageToAll(RED, str);
SendClientMessage(killerid, RED, "Spree Killing: You have been given $25000!");
GameTextForPlayer(killerid,"~p~Spree Killing");
GivePlayerMoney(killerid,25000);
SetWantedLevel(killerid,25);
}
else if(Rampage[killerid] == 30){
GetPlayerName(killerid, str, sizeof(str) );
format(str, sizeof(str), "%s has %d kills in a row!", str, Rampage[killerid] );
SendClientMessageToAll(RED, str);
SendClientMessage(killerid, RED, "Spree Killing: You have been given $30000!");
GameTextForPlayer(killerid,"~p~Spree Killing");
GivePlayerMoney(killerid,30000);
SetWantedLevel(killerid,30);
}
else if(Rampage[killerid] == 35){
GetPlayerName(killerid, str, sizeof(str) );
format(str, sizeof(str), "%s has %d kills in a row!", str, Rampage[killerid] );
SendClientMessageToAll(RED, str);
SendClientMessage(killerid, RED, "Spree Killing: You have been given $35000!");
GameTextForPlayer(killerid,"~p~Spree Killing");
GivePlayerMoney(killerid,35000);
SetWantedLevel(killerid,35);
}
public SetPlayerWanted(playerid, amount)
{
new Wanted;
PlayerInfo[playerid][wanted] = amount;
}
public ShowSpree()
{
new Count,i,name[24],string[256];
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerOnSpree(i)) Count++;
if(!Count) return SendClientMessageToAll(BLUE,"No one is on Spree.");
if(Count == 1) {
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerOnSpree(i)) break;
GetPlayerName(i,name,24);
format(string,256,"Players Currenty on Spree: %s[%d]",name,PlayerInfo[wanted]);
return SendClientMessageToAll(COLOR_YELLOW,string);
}
if(Count >= 1) {
new bool:First = false;
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerOnSpree(i)) {
GetPlayerName(i,name,24);
if(!First) {
format(string,256,"Players Currenty on Spree:: %s[%d],",name,PlayerInfo[wanted]);
First = true;
}
else format(string,256,"%s %s[%d]",string,name,PlayerInfo[wanted]);
}
return SendClientMessageToAll(COLOR_YELLOW,string);
}
return 1;
}
public GetPlayerWanted(playerid)
{
return PlayerInfo[playerid][wanted];
}
stock IsPlayerOnSpree(playerid) return PlayerInfo[playerid][wanted] > 4 ? true:false;
public GetPlayerRampage(player[])
{
new xg;
format( file, sizeof( file ), USERS_FILE, player);
xg = dini_Int( file, "Rampage" );
return xg;
}