Script help.
#8

Код:
#define FILTERSCRIPT

#include <a_samp>
#include <ZCMD>

#define AMMO        100

enum eTeam
{
	pTeam,
}

new cInfo[MAX_PLAYERS][eTeam];

new tRedScore; // Sniper Score
new tBlueScore; // Soldier Score

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" [LOADING...] Sniper Class - Loaded !");
	print(" [LOADING...] Soldier Class - Loaded !");
	print("--------------------------------------\n");

	return 1;
}

public OnFilterScriptExit()
{
	print("\n--------------------------------------");
	print(" [LOADING...] Sniper Class - Failed !");
	print(" [LOADING...] Soldier Class - Failed !");
	print("--------------------------------------\n");

	return 1;
}
public OnPlayerConnect(playerid)
{
	ShowPlayerDialog(playerid, 112, DIALOG_STYLE_MSGBOX, "Class Selection", "What class you wanna be ?", "Sniper", "Soldier");
	
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	if(cInfo[killerid][pTeam] == 2)
	    tBlueScore ++;
	    
	else if(cInfo[killerid][pTeam] == 1)
	    tRedScore ++;

	if(tBlueScore == 10)
	{
		for(new i=0; i<MAX_PLAYERS; i++)
		{
		    if(cInfo[i][pTeam] != 1)
		        return 1;

			GivePlayerWeapon(i, WEAPON_MINIGUN, AMMO);
				
			tBlueScore = 0;
		}
	}
	else if(tRedScore == 10)
	{
	    for(new i=0; i<MAX_PLAYERS; i++)
		{
		    if(cInfo[i][pTeam] != 2)
		        return 1;

			GivePlayerWeapon(i, WEAPON_MINIGUN, AMMO);

			tRedScore = 0;
		}
	}
	
	SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
	
	return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 112)
	{
		if(response) cInfo[playerid][pTeam] = 1;
  		else cInfo[playerid][pTeam] = 2;
  		
  		new s[128];
  		format(s,sizeof(s), "You are a %s now ! Enjoy ..", (cInfo[playerid][pTeam] == 1) ? ("Red") : ("Blue"));
  		SendClientMessage(playerid, 0xFF3567FF, s);
	}
	
	return 1;
}
CMD:score(playerid, params[])
{
	new s[128], s2[128], s3[128];

	format(s, sizeof(s), "Red Team Score: %i points", tRedScore);
	format(s2, sizeof(s2), "Blue Team Score: %i points", tBlueScore);
	format(s3, sizeof(s3), "Your class points: %i", GetPlayerScore(playerid));
	
	SendClientMessage(playerid, 0xFF0000FF, s);
	SendClientMessage(playerid, 0x0000FFFF, s2);
	SendClientMessage(playerid, 0xFFFF00FF, s3);
	
	return 1;
}
P.S: Don't save stats before player exit .. if you want that i will make it .

(/score command show teams score)
(#define AMMO will set the ammo of minigun - you can edit it)
Reply


Messages In This Thread
New Edit - SCRIPT HELP - by Sam15 - 19.07.2015, 14:52
Re: Script help. - by Glenn332 - 19.07.2015, 14:55
Re: Script help. - by Sam15 - 19.07.2015, 16:30
Re: Script help. - by Mariciuc223 - 19.07.2015, 16:38
Re: Script help. - by Sam15 - 20.07.2015, 01:36
Re: Script help. - by Sithis - 20.07.2015, 05:41
Re: Script help. - by Sam15 - 20.07.2015, 08:50
Re: Script help. - by Mariciuc223 - 20.07.2015, 09:40
Re: Script help. - by Sam15 - 20.07.2015, 14:24
Re: Script help. - by Mariciuc223 - 20.07.2015, 15:26

Forum Jump:


Users browsing this thread: 1 Guest(s)