20.07.2015, 09:40
Код:
#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; }
(/score command show teams score)
(#define AMMO will set the ammo of minigun - you can edit it)