Jump to content
  • 0

Intrebare


Jirk

Question

Cum pot adauga masini in stock, am urmatoarea comanda pentru adaugare:

 

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;
}

350x20_FFFFFF_FFFFFF_000000_000000.png

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
CMD:setcar(playerid, params[])
{
	if(gPlayerLogged[playerid] == 0) 
			return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi  mai intai.");
			
	if(IsPlayerConnected(playerid))
	{
		new model = 0, test = 0, string[64], car[30],
		tableid = MySQLCheckCar(car);
		
		if(PlayerInfo[playerid][pAdmin] < 5) 
				return SCM(playerid,COLOR_DS,AdminOnly);
		
		if(sscanf(params, "d[10]is[30]",model,test,car)) 
				return SendClientMessage(playerid, 0xFFFFFFFF, "{B8DBFF}Syntax: /setcar <Stock/Price> <Ammount> <Car Name>");

		if(tableid == 0) 
				return SCM(playerid,COLOR_DS,"{37B9C8}Invalid car name.");
		
		mysql_format(handle, query, sizeof(query), "INSERT INTO stock (Model, Pret, Nume) VALUES ('%e', '%d', '%e')", model, test, car);
		mysql_tquery(handle, query, "OnRegistration", "i", playerid);
			
	}
	return 1;
}

ai un model, te descurci de aici

Link to comment
Share on other sites

  • 0
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.