15.03.2012, 14:33
Код:
#include <a_samp> new exp[MAX_PLAYERS]; new level[MAX_PLAYERS]; forward exptimer(); public OnGameModeInit() { SetTimer("exptimer", 60000, 1); return 1; } public exptimer() { for(new i=0; i<MAX_PLAYERS; i++) { exp[i] += 1; if(exp[i] == 400 && level[i] == 0) { SendClientMessage(i,0xFFFFFFFF,"Level up,you are now level 1!"); level[i] = 1; exp[i] = 0; } if(exp[i] == 800 && level[i] == 1) { SendClientMessage(i,0xFFFFFFFF,"Level up,you are now level 2!"); level[i] = 2; exp[i] = 0; } if(exp[i] == 1200 && level[i] == 2) { SendClientMessage(i,0xFFFFFFFF,"Level up,you are now level 3!"); level[i] = 3; exp[i] = 0; } if(exp[i] == 1600 && level[i] == 3) { SendClientMessage(i,0xFFFFFFFF,"Level up,you are now level 4!"); level[i] = 4; exp[i] = 0; } } return 1; }
if you get 400 exp you will get level 1 and it will reset your exp and so on