Jump to content
  • 0

Problema comanda /levelup


Question

Posted

Salut , am creeat si eu o comanda pentru mysql , comanda /levelup . Aceasta comanda , are ideea , ca poate fii folosita de la orice level 2+ , inclusiv lvl 2 , si sa dea ceva . Chestia e ca nu stiu cum sa o fac pentru un gm fara mysql:

CMD:levelup(playerid, params[])
{
	if(PlayerInfo[playerid][pLevel] < 2) return SCM(playerid,COLOR_GREY,"{98cc2a}You must be level 2 to use this!");
	if(PlayerInfo[playerid][pLevelUP] == 0)
	{
		new str[30];
		PlayerInfo[playerid][pLevel] += 1;
		SetPlayerScore(playerid, PlayerInfo[playerid][pLevel] );
		GivePlayerCash(playerid, 200000);
		PlayerInfo[playerid][pLevelUP] += 1;
		mysql_format(SQL,str,sizeof(str),"UPDATE `users` SET `LevelUP` = '1' WHERE `name`='%s'",PlayerInfo[playerid][pNormalName]);
		mysql_tquery(SQL,str,"","");
        Update(playerid, pLevelUPx);
        Update(playerid, pCashx);	
        SendClientMessage(playerid,COLOR_NEWBIE,"{b5b5b7}Ai primit 1 Level + 200k!");
	}
	else return SCM(playerid,COLOR_GREY,"{98cc2a}Nu mai poti folosi aceasta comanda!");
	return 1;
}

 

13 answers to this question

Recommended Posts

  • 0
  • Administrator
Posted

Trebuie sa stergi ce tine de MySQL, adica astea

mysql_format(SQL,str,sizeof(str),"UPDATE `users` SET `LevelUP` = '1' WHERE `name`='%s'",PlayerInfo[playerid][pNormalName]);
mysql_tquery(SQL,str,"","");
Update(playerid, pLevelUPx);
Update(playerid, pCashx);	

Si dupa cand salvezi datele jucatorului sa salvezi si variabila pLevelUP. Uita-te cum se salveaza si celelalte.

  • Upvote 1
  • 0
Posted
Just now, Shoo7eR said:

Si care este problema? ca nu inteleg? Nu merge comanda sau ce?

pai nu stiu sa o fac pentru un gm fara mysql  , daca ma poate ajuta cineva sa o fac fara chestiile alea de la sql 

  • 0
Posted
Acum 1 minut, Yamato a spus:

pai nu stiu sa o fac pentru un gm fara mysql  , daca ma poate ajuta cineva sa o fac fara chestiile alea de la sql 

    if(strcmp(cmd, "/levelup", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pLevel] == 2)
            {
                PlayerInfo[playerid][pLevel] += 1;
                GivePlayerMoney(playerid, 200000);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "  Felicitari, ai primit Level 3 + $300,0000 ");
            }
            else
            {
            SendClientMessage(playerid, COLOR_LIGHTGREEN, " Trebuie sa ai level 2 pentru a folosi aceasta comanda.");
            }
        }
        return 1;
    }

Foloseste asta pentru un gm fara mysql. Modifici dupa placul tau.

  • 0
Posted

Nu m-ai inteles ce nu stiu :)) , vreau ca comanda poata fii folosita o singura data , dar , minim lvl 2 , si maxim nu exista , asta nu stiu sa fac :)

  • 0
Posted
Acum 3 minute, Yamato a spus:

Nu m-ai inteles ce nu stiu :)) , vreau ca comanda poata fii folosita o singura data , dar , minim lvl 2 , si maxim nu exista , asta nu stiu sa fac :)

adica cel care foloseste comanda sa o poata folosi daca are ori ce nivel mai mare si egal cu 2? Dar sa o poata folosi o singura data?

 

  • 0
Posted
8 minutes ago, WopsS said:

Trebuie sa stergi ce tine de MySQL, adica astea


mysql_format(SQL,str,sizeof(str),"UPDATE `users` SET `LevelUP` = '1' WHERE `name`='%s'",PlayerInfo[playerid][pNormalName]);
mysql_tquery(SQL,str,"","");
Update(playerid, pLevelUPx);
Update(playerid, pCashx);	

Si dupa cand salvezi datele jucatorului sa salvezi si variabila pLevelUP. Uita-te cum se salveaza si celelalte.

cum poti salva asta ? 

  • 0
  • Administrator
Posted
1 minute ago, Yamato said:

cum poti salva asta ? 

Nu inteleg ce vrei sa spui.

  • 0
Posted

nu stiu sa salvez ce ai spus , aia e problema la comanda , defapt 

Quote

cand salvezi datele jucatorului sa salvezi si variabila pLevelUP.

 

  • 0
  • Administrator
Posted

Uita-te cum salvezi celalalte variabile (probabil faci asta la OnPlayerDisconnect) si salveaz si pLevelUP.

  • 0
Posted
Just now, WopsS said:

Uita-te cum salvezi celalalte variabile (probabil faci asta la OnPlayerDisconnect) si salveaz si pLevelUP.

aaaa , hai ca incerc acum sa vad , poate merge 

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.