Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: [GU:RP] ivica 156 poslato Jun 21, 2012, 16:53:00 POSLE PODNE

Naslov: [Pomoc] hitno automatski level
Poruka od: [GU:RP] ivica 156 poslato Jun 21, 2012, 16:53:00 POSLE PODNE
Skripta koju koristim:cyber
Detaljan opis problema:kako da napravim da ako neki neki igrac ima recimo 24/24 respekta da dobije level up ali da bude automatski ne da mora kucat komandu /podigni level
Dio skripte:
Neke slike/video za lakse dobivanje pomoci(neobavezno):
Naslov: Odg: [Pomoc] hitno automatski level
Poruka od: ...Nikola... poslato Jun 21, 2012, 16:59:50 POSLE PODNE
U Public PayDay iz tvoje komande za prelazak levela uzmi onaj deo koji proverava koliko igrac ima respekta i ubaci ga
Naslov: Odg: [Pomoc] hitno automatski level
Poruka od: Dude poslato Jun 21, 2012, 17:00:34 POSLE PODNE
na paydayu provjeri jel varijabla sa respektima >= iznosu koji treba za taj level, ako je veca onda ostavi visak u toj varijabli... eto to je to, a princip provjere je jednak kao u komandi...
Naslov: Odg: [Pomoc] hitno automatski level
Poruka od: [GU:RP] ivica 156 poslato Jun 21, 2012, 17:01:59 POSLE PODNE
e sada ovo je moja cmd koji dio da prebacim u payday public?

if (strcmp(cmd, "/levelup", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
if (gPlayerLogged[playerid] != 0)
{
//PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
//GameTextForPlayer(playerid, string, 5000, 1);
if(PlayerInfo[playerid][pLevel] >= 0)
{
new nxtlevel = PlayerInfo[playerid][pLevel]+1;
new expamount = nxtlevel*levelexp;
new infostring[256];
if (PlayerInfo[playerid][pExp] < expamount)
{
format(infostring, 256, "Trebate imati %d Respekata, trenutno imate %d !",expamount,PlayerInfo[playerid][pExp]);
SendClientMessage(playerid, COLOR_GRAD1, infostring);
return 1;
}
else
{
format(infostring, 256, "[Level up +++] Cestitamo, Presli ste na level %d", nxtlevel);
SendClientMessage(playerid, SVETLOPLAVA , infostring);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerPlayMusic(playerid);
PlayerInfo[playerid][pLevel]++;
if(PlayerInfo[playerid][twixDonatorRank] > 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;
format(infostring, 256, "Sada ste level %d upisite /upgrade", nxtlevel);
SendClientMessage(playerid, COLOR_GRAD1, infostring);
format(infostring, 256, "Imate %d nepotrosenih Upgrade Poena",PlayerInfo[playerid][gPupgrade]);
SendClientMessage(playerid, COLOR_GRAD2, infostring);
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Nisi logiran!");
}
}
return 1;
}

Naslov: Odg: [Pomoc] hitno automatski level
Poruka od: ...Nikola... poslato Jun 21, 2012, 17:04:08 POSLE PODNE
Ovako bi trebalo
new nxtlevel = PlayerInfo[playerid][pLevel]+1;
new expamount = nxtlevel*levelexp;
new infostring[256];
if (PlayerInfo[playerid][pExp] < expamount)
{
format(infostring, 256, "[Level up +++] Cestitamo, Presli ste na level %d", nxtlevel);
SendClientMessage(playerid, SVETLOPLAVA , infostring);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerPlayMusic(playerid);
PlayerInfo[playerid][pLevel]++;
if(PlayerInfo[playerid][twixDonatorRank] > 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;
format(infostring, 256, "Sada ste level %d upisite /upgrade", nxtlevel);
SendClientMessage(playerid, COLOR_GRAD1, infostring);
format(infostring, 256, "Imate %d nepotrosenih Upgrade Poena",PlayerInfo[playerid][gPupgrade]);
SendClientMessage(playerid, COLOR_GRAD2, infostring);
}
Naslov: Odg: [Pomoc] hitno automatski level
Poruka od: [GU:RP] ivica 156 poslato Jun 21, 2012, 18:35:51 POSLE PODNE
jel zna jos neko kako da rijesim taj problem ;)
Naslov: Odg: [Pomoc] hitno automatski level
Poruka od: vlado_plavsic poslato Jun 21, 2012, 18:44:11 POSLE PODNE
A sve su ti lepo rekli...Evo kako to treba da izgleda...


new respect = PlayerInfo[playerid][pLevel] + 1;
new lvlprovera = respect*4; // Ovo 4 je onaj broj na koliko respecta ti ide lvlup.
if(PlayerInfo[playerid][pRespect] >= lvlprovera)
{
PlayerInfo[playerid][pLevel] += 1;
SCM(playerid, -1, " Dobili ste automatski levelup ");
}
Naslov: Odg: [Pomoc] hitno automatski level
Poruka od: [GU:RP] ivica 156 poslato Jun 21, 2012, 18:45:28 POSLE PODNE
to ubacim bilo gdje u public payday?
Naslov: Odg: [Pomoc] hitno automatski level
Poruka od: vlado_plavsic poslato Jun 21, 2012, 18:46:17 POSLE PODNE
Citat: [GU:RP] ivica 156 poslato Jun 21, 2012, 18:45:28 POSLE PODNE
to ubacim bilo gdje u public payday?

Ah da...