Jump to content
  • 0

Problema vipname


rObY.

Question

Cand dau /vipname, nu mi se pune text-ul pe masina. 

CMD:vipname(playerid, params[]) {
	if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_GREY, "Nu esti intr-un vehicul!");
	new carid = GetPlayerVehicleID(playerid),idcar=-1;
	for(new vv; vv < MAX_PERSONAL_VEHICLES; vv++)
	{
		if(carid == PlayerInfo[playerid][pCarID][vv]) {
			idcar = vv;
		}
	}
	if(idcar == -1) return SCM(playerid, COLOR_LGREEN, "Poti folosi aceasta comanda doar pe vehicule VIP.");
	if(carid == PlayerInfo[playerid][pCarID][idcar]) {
		if(PlayerInfo[playerid][pCarVIP][idcar] > 0) {
			new query[256],text[20],test[20];
			if(sscanf(params, "s[20]", text)) return SCM(playerid,COLOR_DCHAT, "Syntax:{ffffff} /vipname [vipname text]");
			if(strlen(text) > 20) return SCM(playerid, COLOR_LGREEN, "Maximum 20 characters are allowed.");
			if(strlen(text) == 0) return 1;
			format(CarVipName[playerid][idcar], 20, text);
			SetVipText(playerid, idcar);
			mysql_real_escape_string(text, test);
			mysql_format(SQL, query, sizeof(query), "UPDATE `cars` SET `VipText`='%s' WHERE `ID`='%d'", test, PlayerInfo[playerid][pCar][idcar]);
			mysql_tquery(SQL, query, "", "");
			format(query, sizeof(query), "Text pentru vehicul setat: %s", text);
			SCM(playerid, COLOR_ADMCOMMANDS, query);
		}
		else return SCM(playerid, COLOR_LGREEN, "Poti folosi aceasta comanda doar pe vehicule VIP.");
	}
	else return SCM(playerid, COLOR_LGREEN, "Poti folosi aceasta comanda doar pe vehicule VIP.");
	return true; }

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
7 hours ago, zNx[] said:

Arata-ne functia 

SetVipText
function SetVipText(playerid, idcar) {
	new string[128];
	if(strlen(CarVipName[playerid][idcar]) > 0) {	
		DestroyObject(vObject[PlayerInfo[playerid][pCarID][idcar]]);
		vObject[PlayerInfo[playerid][pCarID][idcar]] = CreateObject(19327,0,0,-1000,0,0,0,100);

		format(string, sizeof(string), "{%s}%s", serverPremiumColors(PlayerInfo[playerid][pCarVipColor][idcar]), CarVipName[playerid][idcar]);
		SetObjectMaterialText(vObject[PlayerInfo[playerid][pCarID][idcar]], string, 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 30, 1, 0xFFFFFFFF, 0, 1);
		
		if(PlayerInfo[playerid][pCarModel][idcar] == 411) AttachObjectToVehicle(vObject[PlayerInfo[playerid][pCarID][idcar]], PlayerInfo[playerid][pCarID][idcar], -0.029999, -1.974998, 0.233999, -84.824964, 0.000000, 0.000000);
		else if(PlayerInfo[playerid][pCarModel][idcar] == 541) AttachObjectToVehicle(vObject[PlayerInfo[playerid][pCarID][idcar]], PlayerInfo[playerid][pCarID][idcar], 0.000000, -1.649998, 0.390999, -76.379989, 0.000000, 0.000000);
		else if(PlayerInfo[playerid][pCarModel][idcar] == 560) AttachObjectToVehicle(vObject[PlayerInfo[playerid][pCarID][idcar]], PlayerInfo[playerid][pCarID][idcar], 0.000000, -0.614999, 0.799999, -88.439956, 0.000000, 0.000000);
	}
	return true; }

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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