Sign in to follow this  
andrei997

[UNSOLVED]Comanda upgradetovip

9 posts in this topic

Salut, am facut o comanda prin care playerii isi pot pune vip pe masina dar problema este ca vip-ul nu se salveaza si in baza de date. Va las mai jos codul ca sa vedeti mai clar despre ce e vorba..

CMD:upgradetovip(playerid, params[])
{
	if(PinLogged[playerid] == 0) return SCM(playerid, COLOR_LIGHTRED, "Trebuie sa introduci pin-ul mai intai. (/pin)");
	if(PlayerInfo[playerid][pPremiumAccount] != 2) return SCM(playerid, COLOR_YELLOW, "Nu detii un cont VIP! Tasteaza /vipinfo pentru mai multe detalii!");
 	if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER && GetPlayerState(playerid) != PLAYER_STATE_PASSENGER) return SCM(playerid, COLOR_WHITE, "Nu esti intr-un vehicul.");
 	new vehicleid = GetPlayerVehicleID(playerid);
 	new tipvehicul = GetVehicleModel(vehicleid);
 	if(tipvehicul != 411) return SCM(playerid, -1, "Nu poti pune VIP pe alta masina in afara de Infernus!");
  	if(OwnedVeh(vehicleid) && CarInfo[cInfo][cVip] == 0) {
	    CarInfo[cInfo][cVip] = 1;
	    vUpdate(OwnedVeh(vehicleid), cVipx);
	    PlayerInfo[playerid][pPremiumPoints] -= 50;
	    SCM(playerid, COLOR_YELLOW, "Masina ta este acum o masina VIP!");
        new str[300],strings[200];
		mysql_format(SQL,str,sizeof(str),"UPDATE users SET `PremiumPoints`='%d' WHERE `name`='%s'",PlayerInfo[playerid][pPremiumPoints],PlayerInfo[playerid][pNormalName]);
		mysql_tquery(SQL,str,"","");
		mysql_format(SQL,strings,sizeof(strings),"UPDATE cars SET `Vip`='%d' WHERE `ID`='%d'",CarInfo[cInfo][cVip],CarInfo[cInfo][cID]);
		mysql_tquery(SQL,strings,"","");
	}
	return 1;
}

Share this post


Link to post
Share on other sites

Ai baza de data mysql facuta de tine tot ?

Share this post


Link to post
Share on other sites

mysql_log e gol, am verificat si eu acolo si da, CaRa, baza este facuta de mine si am adaugat toate chestiile necesare..

Share this post


Link to post
Share on other sites

mysql_log e gol, am verificat si eu acolo si da, CaRa, baza este facuta de mine si am adaugat toate chestiile necesare..

ai verificat daca conexiunea la baza se face?? 

Share this post


Link to post
Share on other sites

Da, se face. Daca nu s-ar face nu as putea nici eu sa ma loghez pe joc, conturile fiind tot in baza de date.

Share this post


Link to post
Share on other sites

Da, se face. Daca nu s-ar face nu as putea nici eu sa ma loghez pe joc, conturile fiind tot in baza de date.

Poti sa ne arati structura din baza de date cars?

Share this post


Link to post
Share on other sites

mysql_log e gol, am verificat si eu acolo si da, CaRa, baza este facuta de mine si am adaugat toate chestiile necesare..

 

Daca nu ai erori in mysql atunci ma gandesc ca e vorba la incarcarea datelor ..

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.