|POMOC|CMD:av


Započeo Tommy_Vercetty, Mart 17, 2016, 14:08:55 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: Raven's
Detaljan opis problema: ovako napravio sam cmd :av(adminvehicle) i sada kada kucam /av spawna mi auto ali padne mi na glavu , kako da napravim da odma sjednem u auto !
i imam jos jedan prbolem ako hocu da mi ucita ADMINA ime vozila moram kucati 2 puta /av da bi text pisao
Dio skripte:
Neke slike/video za lakse dobivanje pomoci(neobavezno):

CMD:av(playerid, params[])
{
	if(PlayerInfo[playerid][Admin] > 0)
	{
		new Float:X, Float:Y, Float:Z;
	    GetPlayerPos(playerid, X, Y, Z);
	    if(PlayerInfo[playerid][Admin] == 1)
	    {
	          AddStaticVehicleEx(560, X, Y, Z+5, 0, 0, 0, 6000);
        new newcar = GetPlayerVehicleID(playerid);
  		new vname[24], string[256];
  		new Float:x,Float:y,Float:z; GetVehiclePos(newcar, x,y,z);
  		GetVehicleName(newcar, vname, sizeof(vname));
  		format(string,sizeof(string),"{2F5CBC}[Admin([%d]) {FFFFFF}%s {2F5CBC}Vozilo %s",PlayerInfo[playerid][Admin],GetPlayerNameEx(playerid),vname);
    	VoziloLabel = Create3DTextLabel(string, 0, x, y, z, 7, 0, 10);
  		Attach3DTextLabelToVehicle(VoziloLabel,newcar,0,0,0);
  		LegalGetIn[playerid] = 1;
		PutPlayerInVehicle(playerid, newcar, 0);
	    }
	    else if(PlayerInfo[playerid][Admin] == 1337)
	    {
	          AddStaticVehicleEx(411, X, Y, Z+5, 0, 0, 0, 6000);
        new newcar = GetPlayerVehicleID(playerid);
  		new vname[24], string[256];
  		new Float:x,Float:y,Float:z; GetVehiclePos(newcar, x,y,z);
  		GetVehicleName(newcar, vname, sizeof(vname));
  		format(string,sizeof(string),"{2F5CBC}[Admin([%d]) {FFFFFF}%s {2F5CBC}Vozilo %s",PlayerInfo[playerid][Admin],GetPlayerNameEx(playerid),vname);
    	VoziloLabel = Create3DTextLabel(string, 0, x, y, z, 7, 0, 10);
  		Attach3DTextLabelToVehicle(VoziloLabel,newcar,0,0,0);
  		LegalGetIn[playerid] = 1;
		PutPlayerInVehicle(playerid, newcar, 0);
	    }
	    else if(PlayerInfo[playerid][Admin] == 1338)
	    {
	          AddStaticVehicleEx(451, X, Y, Z+5, 0, 0, 0, 6000);
        new newcar = GetPlayerVehicleID(playerid);
  		new vname[24], string[256];
  		new Float:x,Float:y,Float:z; GetVehiclePos(newcar, x,y,z);
  		GetVehicleName(newcar, vname, sizeof(vname));
  		format(string,sizeof(string),"{2F5CBC}[Admin([%d]) {FFFFFF}%s {2F5CBC}Vozilo %s",PlayerInfo[playerid][Admin],GetPlayerNameEx(playerid),vname);
    	VoziloLabel = Create3DTextLabel(string, 0, x, y, z, 7, 0, 10);
  		Attach3DTextLabelToVehicle(VoziloLabel,newcar,0,0,0);
  		LegalGetIn[playerid] = 1;
		PutPlayerInVehicle(playerid, newcar, 0);
	    }
	    else if(PlayerInfo[playerid][Admin] == 1344)
	    {
	          AddStaticVehicleEx(415, X, Y, Z+5, 0, 0, 0, 6000);
        new newcar = GetPlayerVehicleID(playerid);
  		new vname[24], string[256];
  		new Float:x,Float:y,Float:z; GetVehiclePos(newcar, x,y,z);
  		GetVehicleName(newcar, vname, sizeof(vname));
  		format(string,sizeof(string),"{2F5CBC}[Admin([%d]) {FFFFFF}%s {2F5CBC}Vozilo %s",PlayerInfo[playerid][Admin],GetPlayerNameEx(playerid),vname);
    	VoziloLabel = Create3DTextLabel(string, 0, x, y, z, 7, 0, 10);
  		Attach3DTextLabelToVehicle(VoziloLabel,newcar,0,0,0);
  		LegalGetIn[playerid] = 1;
		PutPlayerInVehicle(playerid, newcar, 0);
	    }
    }
	else
	{
	    SCM(playerid, COLOR_LIGHTBLUE, "Niste ovlaÅ¡teni da koristite ovu Komandu!");
	}
	return 1;
}
znaci da mi ucita ovaj 3d label moram 2 puta kucati /av znaci spavnaju se 2 auta i  onda tek ucita na 1 auto label,i ovdje je stavljeno da me stavi u vozilo ali ne znam u cemu je problem ako moze pomoc

CMD:av(playerid, params[])
{
	if(PlayerInfo[playerid][Admin] > 0)
	{
		new Float:X, Float:Y, Float:Z;
	    GetPlayerPos(playerid, X, Y, Z);
	    if(PlayerInfo[playerid][Admin] == 1)
	    {
	          new newcar = AddStaticVehicleEx(560, X, Y, Z+5, 0, 0, 0, 6000);
			  new vname[24], string[256];
			  new Float:x,Float:y,Float:z; GetVehiclePos(newcar, x,y,z);
  			  GetVehicleName(newcar, vname, sizeof(vname));
	  		  format(string,sizeof(string),"{2F5CBC}[Admin([%d]) {FFFFFF}%s {2F5CBC}Vozilo %s",PlayerInfo[playerid][Admin],GetPlayerNameEx(playerid),vname);
    	      VoziloLabel = Create3DTextLabel(string, 0, x, y, z, 7, 0, 10);
	  		  Attach3DTextLabelToVehicle(VoziloLabel,newcar,0,0,0);
	  		  LegalGetIn[playerid] = 1;
		      PutPlayerInVehicle(playerid, newcar, 0);
	    }
	    else if(PlayerInfo[playerid][Admin] == 1337)
	    {
	          new newcar = AddStaticVehicleEx(411, X, Y, Z+5, 0, 0, 0, 6000);
			  new vname[24], string[256];
			  new Float:x,Float:y,Float:z; GetVehiclePos(newcar, x,y,z);
  			  GetVehicleName(newcar, vname, sizeof(vname));
	  		  format(string,sizeof(string),"{2F5CBC}[Admin([%d]) {FFFFFF}%s {2F5CBC}Vozilo %s",PlayerInfo[playerid][Admin],GetPlayerNameEx(playerid),vname);
    	      VoziloLabel = Create3DTextLabel(string, 0, x, y, z, 7, 0, 10);
	  		  Attach3DTextLabelToVehicle(VoziloLabel,newcar,0,0,0);
	  		  LegalGetIn[playerid] = 1;
		      PutPlayerInVehicle(playerid, newcar, 0);
	    }
	    else if(PlayerInfo[playerid][Admin] == 1338)
	    {
	          new newcar = AddStaticVehicleEx(451, X, Y, Z+5, 0, 0, 0, 6000);
			  new vname[24], string[256];
			  new Float:x,Float:y,Float:z; GetVehiclePos(newcar, x,y,z);
  			  GetVehicleName(newcar, vname, sizeof(vname));
	  		  format(string,sizeof(string),"{2F5CBC}[Admin([%d]) {FFFFFF}%s {2F5CBC}Vozilo %s",PlayerInfo[playerid][Admin],GetPlayerNameEx(playerid),vname);
    	      VoziloLabel = Create3DTextLabel(string, 0, x, y, z, 7, 0, 10);
	  		  Attach3DTextLabelToVehicle(VoziloLabel,newcar,0,0,0);
	  		  LegalGetIn[playerid] = 1;
		      PutPlayerInVehicle(playerid, newcar, 0);
	    }
	    else if(PlayerInfo[playerid][Admin] == 1344)
	    {
	          new newcar = AddStaticVehicleEx(415, X, Y, Z+5, 0, 0, 0, 6000);
			  new vname[24], string[256];
			  new Float:x,Float:y,Float:z; GetVehiclePos(newcar, x,y,z);
  			  GetVehicleName(newcar, vname, sizeof(vname));
	  		  format(string,sizeof(string),"{2F5CBC}[Admin([%d]) {FFFFFF}%s {2F5CBC}Vozilo %s",PlayerInfo[playerid][Admin],GetPlayerNameEx(playerid),vname);
    	      VoziloLabel = Create3DTextLabel(string, 0, x, y, z, 7, 0, 10);
	  		  Attach3DTextLabelToVehicle(VoziloLabel,newcar,0,0,0);
	  		  LegalGetIn[playerid] = 1;
		      PutPlayerInVehicle(playerid, newcar, 0);
	    }
    }
	else
	{
	    SCM(playerid, COLOR_LIGHTBLUE, "Niste ovlaÅ¡teni da koristite ovu Komandu!");
	}
	return 1;
}

CMD:av(playerid, params[])
{
	if(PlayerInfo[playerid][Admin] > 0)
	{
    if(PlayerInfo[playerid][Admin] == 1)
	    {
                new vozilo1,string[256],vname[24];
    	        new Float:Pos[4];
	        GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
		SendClientMessage(playerid, -1, "Spawnao si Admin vozilo!");
                vozilo1 = CreateVehicle(560,Pos[0],Pos[1],Pos[2],Pos[3],random(1),random(1),500);
                LegalGetIn[playerid] = 1;
		PutPlayerInVehicle(playerid,vozilo1,0);
                GetVehicleName(vozilo1 vname, sizeof(vname));
  		format(string,sizeof(string),"{2F5CBC}[Admin([%d]) {FFFFFF}%s {2F5CBC}Vozilo %s",PlayerInfo[playerid]              [Admin],GetPlayerNameEx(playerid),vname);
    	        new Text3D:avozila;
  		Attach3DTextLabelToVehicle(avozila,vozilo1,0,0,0);
                Update3DTextLabelText(avozila, 0x90C9C9FF, "%s",string);
	    }
	else
	{
	    SCM(playerid, COLOR_LIGHTBLUE, "Niste ovlaÅ¡teni da koristite ovu Komandu!");
	}
	return 1;
}

Evo ti mozda bude errora........

Citat: K ROSE poslato Mart 17, 2016, 15:00:10 POSLE PODNE
CMD:av(playerid, params[])
{
	if(PlayerInfo[playerid][Admin] > 0)
	{
		new Float:X, Float:Y, Float:Z;
	    GetPlayerPos(playerid, X, Y, Z);
	    if(PlayerInfo[playerid][Admin] == 1)
	    {
	          new newcar = AddStaticVehicleEx(560, X, Y, Z+5, 0, 0, 0, 6000);
			  new vname[24], string[256];
			  new Float:x,Float:y,Float:z; GetVehiclePos(newcar, x,y,z);
  			  GetVehicleName(newcar, vname, sizeof(vname));
	  		  format(string,sizeof(string),"{2F5CBC}[Admin([%d]) {FFFFFF}%s {2F5CBC}Vozilo %s",PlayerInfo[playerid][Admin],GetPlayerNameEx(playerid),vname);
    	      VoziloLabel = Create3DTextLabel(string, 0, x, y, z, 7, 0, 10);
	  		  Attach3DTextLabelToVehicle(VoziloLabel,newcar,0,0,0);
	  		  LegalGetIn[playerid] = 1;
		      PutPlayerInVehicle(playerid, newcar, 0);
	    }
	    else if(PlayerInfo[playerid][Admin] == 1337)
	    {
	          new newcar = AddStaticVehicleEx(411, X, Y, Z+5, 0, 0, 0, 6000);
			  new vname[24], string[256];
			  new Float:x,Float:y,Float:z; GetVehiclePos(newcar, x,y,z);
  			  GetVehicleName(newcar, vname, sizeof(vname));
	  		  format(string,sizeof(string),"{2F5CBC}[Admin([%d]) {FFFFFF}%s {2F5CBC}Vozilo %s",PlayerInfo[playerid][Admin],GetPlayerNameEx(playerid),vname);
    	      VoziloLabel = Create3DTextLabel(string, 0, x, y, z, 7, 0, 10);
	  		  Attach3DTextLabelToVehicle(VoziloLabel,newcar,0,0,0);
	  		  LegalGetIn[playerid] = 1;
		      PutPlayerInVehicle(playerid, newcar, 0);
	    }
	    else if(PlayerInfo[playerid][Admin] == 1338)
	    {
	          new newcar = AddStaticVehicleEx(451, X, Y, Z+5, 0, 0, 0, 6000);
			  new vname[24], string[256];
			  new Float:x,Float:y,Float:z; GetVehiclePos(newcar, x,y,z);
  			  GetVehicleName(newcar, vname, sizeof(vname));
	  		  format(string,sizeof(string),"{2F5CBC}[Admin([%d]) {FFFFFF}%s {2F5CBC}Vozilo %s",PlayerInfo[playerid][Admin],GetPlayerNameEx(playerid),vname);
    	      VoziloLabel = Create3DTextLabel(string, 0, x, y, z, 7, 0, 10);
	  		  Attach3DTextLabelToVehicle(VoziloLabel,newcar,0,0,0);
	  		  LegalGetIn[playerid] = 1;
		      PutPlayerInVehicle(playerid, newcar, 0);
	    }
	    else if(PlayerInfo[playerid][Admin] == 1344)
	    {
	          new newcar = AddStaticVehicleEx(415, X, Y, Z+5, 0, 0, 0, 6000);
			  new vname[24], string[256];
			  new Float:x,Float:y,Float:z; GetVehiclePos(newcar, x,y,z);
  			  GetVehicleName(newcar, vname, sizeof(vname));
	  		  format(string,sizeof(string),"{2F5CBC}[Admin([%d]) {FFFFFF}%s {2F5CBC}Vozilo %s",PlayerInfo[playerid][Admin],GetPlayerNameEx(playerid),vname);
    	      VoziloLabel = Create3DTextLabel(string, 0, x, y, z, 7, 0, 10);
	  		  Attach3DTextLabelToVehicle(VoziloLabel,newcar,0,0,0);
	  		  LegalGetIn[playerid] = 1;
		      PutPlayerInVehicle(playerid, newcar, 0);
	    }
    }
	else
	{
	    SCM(playerid, COLOR_LIGHTBLUE, "Niste ovlaÅ¡teni da koristite ovu Komandu!");
	}
	return 1;
}

hvala kRose radi , jel mozes da mi pomognes oko komande za unistavanje ovih admin cmd npr cmd da se zove CMD:avd(adminvehicledestroy) :D hvala

Napravi PLAYER varijablu i onda:
Vehicle[ playerid ] = CreateVehicle( ... );

//a za brisanje: 
DestroyVehicle( Vehicle[ playerid ] ); Vehicle[ playerid ] = -1;

You have enemies? Good. That means you've stood up for something, sometime in your life.

YCMD:adv(playerid, params[], help)
{
    #pragma unused params
	if(help) return SCM(playerid, COLOR_GREY, "Not supported");
	
	if(PlayerInfo[playerid][Admin] > 0)
	{
		if(GetPlayerState(playerid) == 2)
		{
			new newcar = GetPlayerVehicleID(playerid);
			SafeRemovePlayerFromVehicle(playerid);
			DestroyVehicle(newcar);
		}
	}
	else
	{
		SCM(playerid, COLOR_LIGHTBLUE, "Niste ovlašteni da koristite ovu komandu !");
	}
	return 1;
}

Citat: K ROSE poslato Mart 17, 2016, 17:16:58 POSLE PODNE
YCMD:adv(playerid, params[], help)
{
    #pragma unused params
	if(help) return SCM(playerid, COLOR_GREY, "Not supported");
	
	if(PlayerInfo[playerid][Admin] > 0)
	{
		if(GetPlayerState(playerid) == 2)
		{
			new newcar = GetPlayerVehicleID(playerid);
			SafeRemovePlayerFromVehicle(playerid);
			DestroyVehicle(newcar);
		}
	}
	else
	{
		SCM(playerid, COLOR_LIGHTBLUE, "Niste ovlašteni da koristite ovu komandu !");
	}
	return 1;
}

Radi , jel mi mozes jo samo u cmd napisati kad stovirm auto : Stvorili ste admin vozilo , a akd ga unistavam : Unistili ste admin vozilo. HVALA K ROSE <3

Zar je teško pogledati na wikipediji SendClientMessage funkciju i njene sintakse ?
Isto tako u Skripti imaš gomilu tih funkcija, svaka ta funkcija služi da informiše igraca.
Sada postoje dva nacina kako ces da se informišeš, dali preko stringa ili SendClientMessage.

Ako ceš preko stringa onda tamo gdje stvaraš vozilo staviš ovako:

format(string,sizeof(string),"Ulazite u %s (%d)   Vlasnik: Admin",vname, newcar);
SCM(playerid, COLOR_LIGHTBLUE, string);


A ako neceš preko stringa onda tamo gdje stvaraš vozilo staviš ovako:

SCM(playerid, COLOR_ASKQ, "Stvorili ste Admin Vozilo, da ga uništite kucajte /avd");

Jednostavno
CMD:adv(playerid, params[])
{
	
	if(PlayerInfo[playerid][Admin] > 0)
	{
		if(GetPlayerState(playerid) == 2)
		{
			new newcar = GetPlayerVehicleID(playerid);
			SafeRemovePlayerFromVehicle(playerid);
			DestroyVehicle(newcar);
                        SCM(playerid, CRVENA, "Unistili ste admin vozilo!");
		}
	}
	else
	{
		SCM(playerid, COLOR_LIGHTBLUE, "Niste ovlašteni da koristite ovu komandu !");
	}
	return 1;
}


Valjda je to to

"They have computers, and they may have other weapons of mass destruction."

Hvala, ima bug neki npr kada kucam /av ,unistim  kola kucam /veh 522 0 0 (primjer) onda mi ostane label i pise ovako http://prntscr.com/aghwzs


ovo dodam u cmd ?
MyLabel = Create3DTextLabel(...);

Delete3DTextLabel(MyLabel);

Rjeseno , hvala k ROSE
Moze lock