Jump to content

Question

Posted

Buna seara , am o problema la sv meu de samp.

Modul e RP .

E o problema dupa ce cumperi level , iti ramane level-ul pentru 10-15sec si dupa iar iti da level-ul ce il aveai.

Nu stiu ce sa fac..ma poate ajuta cineva , niste idei ceva ? ...

* ID Yahoo Messenger: SaMp_CrYsTy

10 answers to this question

Recommended Posts

  • Administrator
Posted

Da-ne ceva indici ... Ai serverul pe MySQL sau Dini? Arata-ne comanda, faci cumva update la statusul playerilor?

Posted

Uite aici

//-------------------------------[LevelUp]--------------------------------------------------------------------------
	if (strcmp(cmd, "/levelup", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if (gPlayerLogged[playerid] != 0)
			{
				/*PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);*/
				if(PlayerInfo[playerid][pLevel] >= 0)
				{
					new nxtlevel = PlayerInfo[playerid][pLevel]+1;
					/*new costlevel = nxtlevel*levelcost;//10k for testing purposes*/
					new expamount = nxtlevel*levelexp;
					new infostring[256];
					/*if(GetPlayerMoney(playerid) < costlevel)
					{
						format(infostring, 256, "   You do not have enough Cash ($%d)!",costlevel);
						SendClientMessage(playerid, COLOR_GRAD1, infostring);
						return 1;
					}*/
					if (PlayerInfo[playerid][pExp] < expamount)
					{
						format(infostring, 256, "   You need %d Respect Points, you curently have [%d] !",expamount,PlayerInfo[playerid][pExp]);
						SendClientMessage(playerid, COLOR_GRAD1, infostring);
						return 1;
					}
					else
					{
						format(string, sizeof(string), "~g~LEVEL UP~n~~w~You Are Now Level %d", nxtlevel);
						PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
						PlayerPlayMusic(playerid);
						/*SafeGivePlayerMoney(playerid, (-costlevel));*/
						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, "   You bought Level %d Type /upgrade", nxtlevel);
						SendClientMessage(playerid, COLOR_GRAD1, infostring);
						format(infostring, 256, "   You gave %d unspent Upgrade Points",PlayerInfo[playerid][gPupgrade]);
						SendClientMessage(playerid, COLOR_GRAD2, infostring);
					}
				}
				return 1;
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   You are not Logged in !");
			}
		}
		return 1;
	}

Nu e MySQL

* ID Yahoo Messenger: SaMp_CrYsTy

Posted

public DollahScoreUpdate()
{
	new LevScore;
	for(new i=0; i<MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
   			LevScore = PlayerInfo[i][pLevel] =3;
			SetPlayerScore(i, LevScore);
		}
	}
	return 1;
}
PlayerInfo[playerid][pLevel] = 2;
if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevel] = strval( val ); }
PlayerInfo[playerid][pLevel] = 1;
if(PlayerInfo[playerid][pLevel] == -999) //autoban
if(PlayerInfo[playerid][pLevel] == 2)

Cam atat.. sper ca ti-am dat ce ti-ai dorit .

* ID Yahoo Messenger: SaMp_CrYsTy

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.