Jump to content
  • 0

Problema


Redzutzuu

Question

Salut, am un server de samp, ruleaza pe MYSQL, merge totul bine, joburi tot, dar nu conteaza asta. Sa va explic problema: La Dealership am o mica problema, nu stiu sa setez masinile care sa fie in stock. Comanda este /setcar si trebuie completat asa: lcTQcQS.png dar nu stiu cum trebuie completata. Toata comanda este aceasta: 

CMD:setcar(playerid, params[])
{
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi  mai intai.");
	if(IsPlayerConnected(playerid))
 	{
		if(PlayerInfo[playerid][pAdmin] < 5) return SCM(playerid,COLOR_DS,AdminOnly);
		new model[10],test,tableid,string[64],car[30];
		if(sscanf(params, "s[10]is[30]",model,test,car)) return SendClientMessage(playerid, 0xFFFFFFFF, "{B8DBFF}Syntax: /setcar <Stock/Price> <Ammount> <Car Name>");
		tableid = MySQLCheckCar(car);
		if(tableid == 0) return SCM(playerid,COLOR_DS,"{37B9C8}Invalid car name.");
		if(strcmp(model,"stock",true) == 0)
     	{
			Stock[tableid][vStock] = test;
			format(string,sizeof(string),"You set the stock to %d.",test);
			SCM(playerid,COLOR_DS,string);
	        format(string, sizeof(string), "UPDATE stock SET Stock='%d' WHERE `ID`='%d'", Stock[tableid][vStock], tableid);
	        mysql_query(SQL,string);
	       	return 1;
        }
        if(strcmp(model,"price",true) == 0)
        {
			Stock[tableid][vPrice] = test;
			format(string,sizeof(string),"You set the price to %s.",FormatNumber(test));
			SCM(playerid,COLOR_DS,string);
	        format(string, sizeof(string), "UPDATE stock SET `Price`='%d' WHERE `ID`='%d'", Stock[tableid][vPrice], tableid);
	        mysql_query(SQL,string);
	        return 1;
        }
 	}
 	return 1;
}

Daca ma puteti ajuta cum sa o completez v-as fi recunoscator. Comanda merge bine, un admin a setat masinile dar am uitat sa il intreb cum..

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Pentru setarea stoc-ului:

 

Incearca "/setcar stock 100 Bravura"

 

100 reprezinta numarul de stoc-uri posibile pentru masina "Bravura". 

 

Pentru setarea pretului:

 

"/setcar price 2000 Bravura"

 

2000 reprezinta pretul vehiculului "Bravura".

Edited by #Teddy

Ocupation: Youtube, Mined Bitcoin's, Scripting & Mapping SA:MP

Link to comment
Share on other sites

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.