Jump to content

[REZOLVAT] vip name


Lexii
 Share

Recommended Posts

Username: Lexii
Problema întălnită: cand scriu textul in dialog nu se intampla nimic 
Detalii despre problemă: cand scriu textul in dialog nu se intampla nimic 
Ce ai încercat să faci înainte să postezi?:/
Cod sursă (recomandat pastebin.com) :/
Alte detalii: poate cineva sa ma ajute ?

 

COD SURSA:

if(dialogid == DIALOG_VIPNAME) 
{
	    if(response) 
		{
	        new carid = GetPlayerVehicleID(playerid),idcar=-1;
	        for(new vv; vv < MAX_PERSONAL_VEHICLES; vv++)
	        {
		    if(carid == PlayerInfo[playerid][pCarID][vv])
		    {
			idcar = vv;
		    }
	    }
	    if(IsPlayerConnected(playerid))
	    {
	    	if(carid == PlayerInfo[playerid][pCarID][idcar])
	    	{
	    		if(PlayerInfo[playerid][pCarVIP][idcar] > 0)
	    		{
	    			new query[256],text[20],test[20];
	    			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);
			    	SendClientMessage(playerid, -1, query);
			    }
	        }
	    }
	}
}

CMD:vipname(playerid, params[])
{
	if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "Nu esti intr-un vehicul!");
	ShowPlayerDialog(playerid, DIALOG_VIPNAME, DIALOG_STYLE_INPUT, "Vip Name", "Scrie textul vip mai jos", "Ok", "Exit");
	return 1;
}

 

Link to comment
Share on other sites

Acum 4 ore, LolyAdv a spus:

trecand cu vederea codul ala hidos, arata functia SetVipText

public SetVipText(playerid, idcar)
{
	new string[128];
	if(strlen(CarVipName[playerid][idcar]) > 0)
	{
		if(PlayerInfo[playerid][pCarVipColors][idcar] == 0) format(string, sizeof(string), "{FFFFFF}%s", CarVipName[playerid][idcar]);
		else if(PlayerInfo[playerid][pCarVipColors][idcar] == 1) format(string, sizeof(string), "{FF0000}%s", CarVipName[playerid][idcar]);
		else if(PlayerInfo[playerid][pCarVipColors][idcar] == 2) format(string, sizeof(string), "{640000}%s", CarVipName[playerid][idcar]);
		else if(PlayerInfo[playerid][pCarVipColors][idcar] == 3) format(string, sizeof(string), "{00FF00}%s", CarVipName[playerid][idcar]);
		else if(PlayerInfo[playerid][pCarVipColors][idcar] == 4) format(string, sizeof(string), "{004B01}%s", CarVipName[playerid][idcar]);
		else if(PlayerInfo[playerid][pCarVipColors][idcar] == 5) format(string, sizeof(string), "{008DFF}%s", CarVipName[playerid][idcar]);
		else if(PlayerInfo[playerid][pCarVipColors][idcar] == 6) format(string, sizeof(string), "{001AFF}%s", CarVipName[playerid][idcar]);
		else if(PlayerInfo[playerid][pCarVipColors][idcar] == 7) format(string, sizeof(string), "{FFFF00}%s", CarVipName[playerid][idcar]);
		else if(PlayerInfo[playerid][pCarVipColors][idcar] == 8) format(string, sizeof(string), "{FF6B00}%s", CarVipName[playerid][idcar]);
		else if(PlayerInfo[playerid][pCarVipColors][idcar] == 9) format(string, sizeof(string), "{EB00FF}%s", CarVipName[playerid][idcar]);
		else if(PlayerInfo[playerid][pCarVipColors][idcar] == 10) format(string, sizeof(string), "{590056}%s", CarVipName[playerid][idcar]);
		else if(PlayerInfo[playerid][pCarVipColors][idcar] == 11) format(string, sizeof(string), "{8A8A8A}%s", CarVipName[playerid][idcar]);
		else if(PlayerInfo[playerid][pCarVipColors][idcar] == 12) format(string, sizeof(string), "{000000}%s", CarVipName[playerid][idcar]); 
		else if(PlayerInfo[playerid][pCarVipColors][idcar] == 13) format(string, sizeof(string), "{28B2E0}%s", CarVipName[playerid][idcar]); 
		else if(PlayerInfo[playerid][pCarVipColors][idcar] == 14) format(string, sizeof(string), "{F20C9A}%s", CarVipName[playerid][idcar]); 
		DestroyObject(vObject[PlayerInfo[playerid][pCarID][idcar]]);
		vObject[PlayerInfo[playerid][pCarID][idcar]] = CreateObject(19327,0,0,-1000,0,0,0,100);
		SetObjectMaterialText(vObject[PlayerInfo[playerid][pCarID][idcar]], string, 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 18, 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);
		else if(PlayerInfo[playerid][pCarModel][idcar] == 451) AttachObjectToVehicle(vObject[PlayerInfo[playerid][pCarID][idcar]], PlayerInfo[playerid][pCarID][idcar], 0.000000, -0.6, 0.56, 270.0, 0.0, 0.0);
		else if(PlayerInfo[playerid][pCarModel][idcar] == 480) AttachObjectToVehicle(vObject[PlayerInfo[playerid][pCarID][idcar]], PlayerInfo[playerid][pCarID][idcar], 0.000000, -1.58, 0.27, 270.0, 0.0, 0.0);
	}
	return 1;
}

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...