crash command
#1

hey guys i have this command to put a text on a car but sometimes the Text wont apear and if i use the command again the server will crash

Код HTML:
new vText;
CMD:carname(playerid, params[])
{
	new text[6], szMessage[256];
	new vehicleid = GetPlayerVehicleID(playerid);
	if(sscanf(params, "s[50]", text)) return SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /carname [name]");
	if(NoBugText[playerid] == 1)return SendClientMessage(playerid, COLOR_LIGHTRED,"Ai deja un text pe masina foloseste /removename");
	if( strcmp( GetName( playerid ), CarInfo[vDBID[vehicleid]][cOwner], true) == 0 )
	{
		if(PlayerInfo[playerid][pPremiumAccount] >= 1)
		{
		    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER && GetPlayerState(playerid) != PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_WHITE, "Nu esti intr-un vehicul.");
	        if( vDBID[ vehicleid ] != 0 )
			{
			    new masina = vDBID[ GetPlayerVehicleID(playerid) ];
			    if((gettime() - VipNameTimer[playerid]) < 120) return SendClientMessage(playerid, COLOR_GREY, "Poti sa folosesti /carname odata la 2 minute!");
		        NoBugText[playerid] = 1;
				vText = CreateObject(19327, -2597.0762, -2638.4270, -5.3536, -87.6999, 90.4001, -87.1805);
				SetObjectMaterialText(vText, text, 0, 50, "Arial", 25, 1, 0xFFFFFFFF, 0, 1);
				AttachObjectToVehicle(vText, masina, 0.0,-1.9, 0.3, 270.0, 0.0, 0.0);
				format(szMessage, sizeof(szMessage), "{F2CF09}Text pentru vehicul setat: '%s'", text);
				SendClientMessage(playerid, COLOR_YELLOW, szMessage);
				VipNameTimer[playerid] = gettime();
				SendClientMessage(playerid, COLOR_YELLOW, "Poti folosi /removename pentru a sterge textul.");
			}
			else
			{
			    SendClientMessage(playerid, COLOR_ERROR, "Aceasta comanda poate fi folosita doar in masina personala");
			}
		}
		else return SendClientMessage(playerid,COLOR_WHITE,"Tu nu detii cont premium!");
	}
	else return SendClientMessage(playerid,COLOR_WHITE,"Acest vehicul nu iti apartine!");
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)