02.10.2011, 15:12
Y Have A Process For Level But when the player gets 8/8 respects he must wrote /levelup to get +Level Can You Give me the code in this public with the /levelup cmd, when the player have 8/8 respect automaticly +Level not to wrote /levelup, Here is The Code
My System
pawn Код:
if (strcmp(cmd, "/levelup", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (gPlayerLogged[playerid] != 0)
{
if(PlayerInfo[playerid][pLevel] >= 0)
{
new nxtlevel = PlayerInfo[playerid][pLevel]+1;
new expamount = nxtlevel*levelexp;
new infostring[128];
if (PlayerInfo[playerid][pExp] < expamount)
{
format(infostring, 256, " Za sledeci level vam treba %d Respekt Poena, a vi imate [%d] !",expamount,PlayerInfo[playerid][pExp]);
SendClientMessage(playerid, COLOR_GRAD1, infostring);
return 1;
}
else
{
format(string, sizeof(string), "~g~LEVEL UP~n~~w~Vi ste sada Level %d", nxtlevel);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerPlayMusic(playerid);
PlayerInfo[playerid][pLevel]++;
if(PlayerInfo[playerid][pDonateRank] > 0)
{
PlayerInfo[playerid][pExp] -= expamount;
new total = PlayerInfo[playerid][pExp];
if(total > 0)
{
PlayerInfo[playerid][pExp] = total;
}
else
{
PlayerInfo[playerid][pExp] = 0;
}
}
else
{
PlayerInfo[playerid][pExp] = 0;
}
PlayerInfo[playerid][gPupgrade] = PlayerInfo[playerid][gPupgrade]+2;
GameTextForPlayer(playerid, string, 5000, 1);
format(infostring, 256, " Kupili ste Level %d Ukucajte /upgrade", nxtlevel);
SendClientMessage(playerid, COLOR_GRAD1, infostring);
format(infostring, 256, " Dali ste %d nepotrosene Upgrade Points-e",PlayerInfo[playerid][gPupgrade]);
SendClientMessage(playerid, COLOR_GRAD2, infostring);
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Niste logirani !");
}
}
return 1;
}
pawn Код:
public ITakoProshoJedanMinut()
{
new i;
for(i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
PlayerInfo[i ][pOdigraniMinuti] ++; // OBRISI RAZMAK KADA KOPIRAЉ KOD
if(PlayerInfo [i ][pOdigraniMinuti] == 30) // OBRISI RAZMAK KADA KOPIRAЉ KOD
{
PlayerInfo[i ][pExp] ++; // OBRISI RAZMAK KADA KOPIRAЉ KOD
PlayerInfo[i ][pOdigraniMinuti] = 0; // OBRISI RAZMAK KADA KOPIRAЉ KOD
ShowClientMesssage(i, COLOR_LIGHTBLUE, "By Mikec: Dobili ste +1 EXP Posto ste igrali 30 minuta na serveru");[/code]
}
}
}