Hy

Itt van ez a plugin,olyan mint a pénzes time present csak ez pajzsot ad.Működik is csak annyi gondom van vele,ha pl. valakinek van 100 pajzsa,akkor nem a 100-hoz adja hozzá az 50-et,hanem csak 50 lesz.Azt jólenne ha valaki megcsinálná hogyha van 100 pajzsom akkor a 100-hoz adja hozzá.Remélem érthetően elmondtam
Kód:
#include <amxmodx>
#include <fun>
/*================================================================================
[Macros]
=================================================================================*/
#define SMALL 65
#define AVERAGE 100
#define LARGE 150
/*================================================================================
[Plugin Init]
=================================================================================*/
public plugin_init()
{
register_plugin("Time Presents", "0.1", "WPMG Team")
}
/*================================================================================
[Set Tasks]
=================================================================================*/
public client_putinserver(id)
{
set_task(180.0, "small_present", id)
set_task(300.0, "average_present", id)
set_task(600.0, "large_present", id)
}
/*================================================================================
[Remove Task]
=================================================================================*/
public client_disconnect(id)
{
if(task_exists(id))
remove_task(id)
}
/*================================================================================
[Give Presents]
=================================================================================*/
public small_present(id)
{
set_user_armor(id, get_user_armor(id) + 65)
client_printcolor(id, "^4[AjandeK] ^1Kaptal ^4%d Pajzsot^1,mert jatszodtal ezen a szerveren^4 3 percet.", SMALL)
}
public average_present(id)
{
set_user_armor(id, get_user_armor(id) + 100)
client_printcolor(id, "^4[AjandeK] ^1Kaptal ^4%d Pajzsot^1, mert jatszodtal ezen a szerveren^4 5 percet.", AVERAGE)
}
public large_present(id)
{
set_user_armor(id, get_user_armor(id) + 150)
client_printcolor(id, "^4[AjandeK] ^1Kaptal ^4%d Pajzsot^1, mert jatszodtal ezen a szerveren^4 10 percet.", LARGE)
}
/*================================================================================
[Stock]
=================================================================================*/
stock client_printcolor(const id, const input[], any:...)
{
new iCount = 1, iPlayers[32]
static szMsg[191]
vformat(szMsg, charsmax(szMsg), input, 3)
replace_all(szMsg, 190, "/g", "^4")
replace_all(szMsg, 190, "/y", "^1")
replace_all(szMsg, 190, "/ctr", "^1")
replace_all(szMsg, 190, "/w", "^0")
if(id) iPlayers[0] = id
else get_players(iPlayers, iCount, "ch")
for (new i = 0; i < iCount; i++)
{
if(is_user_connected(iPlayers[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, iPlayers[i])
write_byte(iPlayers[i])
write_string(szMsg)
message_end()
}
}
}