Witam, proszę o przerobienie wartosci jaka gracz otrzymuje na koniec rundy, chcialbym aby bylo tak:
1 miejsce-600000 doswiadczenia
2 miejsce-300000 doswiadczenia
3 miejsce-200000 doswiadczenia
#include <amxmodx>
#include <amxmisc>
#include <codmod>
#define PLUGIN "Nagrody na koniec mapy"
#define VERSION "1.0"
#define AUTHOR "pRED*"
new gmsgSayText;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_message(SVC_INTERMISSION, "Message_Intermission");
gmsgSayText = get_user_msgid("SayText");
}
public Message_Intermission(){
set_task(0.1, "award_check");
}
public award_check()
{
//Run on SVC_INTERMISSION (Map change)
//Find the top three Fragging players and award them with a star
new players[32], num;
get_players(players, num, "h");
new tempfrags, id;
new swapfrags, swapid;
new starfrags[3]; //0 - 150xp / 1 - 300xp / 2 - 450
new starid[3];
for (new i = 0; i < num; i++)
{
id = players[i];
tempfrags = get_user_frags(id);
if ( tempfrags > starfrags[0] )
{
starfrags[0] = tempfrags;
starid[0] = id;
cod_set_user_xp(starfrags[0], cod_get_user_xp(starfrags[0])+10000);
if ( tempfrags > starfrags[1] )
{
swapfrags = starfrags[1];
swapid = starid[1];
starfrags[1] = tempfrags;
starid[1] = id;
starfrags[0] = swapfrags;
starid[0] = swapid;
cod_set_user_xp(starfrags[1], cod_get_user_xp(starfrags[1])+15000);
if ( tempfrags > starfrags[2] )
{
swapfrags = starfrags[2];
swapid = starid[2];
starfrags[2] = tempfrags;
starid[2] = id;
starfrags[1] = swapfrags;
starid[1] = swapid;
cod_set_user_xp(starfrags[2], cod_get_user_xp(starfrags[2])+20000);
}
}
}
}
new name[32];
new winner = starid[2];
if ( !winner )
return;
new line[100];
line[0] = 0x04;
formatex(line[1], 98, "Najlepsi gracze na tej mapie:");
ShowColorMessage(starid[2], MSG_BROADCAST, line);
//line[0] = 0x04;
get_user_name(starid[2], name, charsmax(name));
line[0] = 0x04;
formatex(line[1], 98, "1. %s - Otrzymuje 20000 XP - %i Zabojstw", name, starfrags[2]);
ShowColorMessage(starid[2], MSG_BROADCAST, line);
get_user_name(starid[1], name, charsmax(name));
line[0] = 0x04;
formatex(line[1], 98, "2. %s - Otrzymuje 15000 XP - %i Zabojstw", name, starfrags[1]);
ShowColorMessage(starid[2], MSG_BROADCAST, line);
get_user_name(starid[0], name, charsmax(name));
line[0] = 0x04;
formatex(line[1], 98, "3. %s - Otrzymuje 10000 XP - %i Zabojstw", name, starfrags[0]);
ShowColorMessage(starid[2], MSG_BROADCAST, line);
}
ShowColorMessage(id, type, message[])
{
message_begin(type, gmsgSayText, _, id);
write_byte(id);
write_string(message);
message_end();
}


Dodatki SourceMod



Temat jest zamknięty


nagrody.amxx








