SA-MP Forums Archive
[AJUDA] Criaзгo de veнculo! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA] Criaзгo de veнculo! (/showthread.php?tid=308167)



[AJUDA] Criaзгo de veнculo! - danktog - 02.01.2012

Olб galera, estou com um FS aqui de criar todos os veнculos... mais quero tirar uns veнculos como Hydra, Hunter, e um cara mim falou pra mim criar uma Stock com os nomes do veнculos proнbidos e depois colocar la no comando.. mais nгo sei fazer isso, se alguem poder mim ajudar ...

Comando:
Код:
dcmd_v(playerid, params[])
{
	new
		idx = 0,
		iString[ 128 ];

	if ( params[ 0 ] == '\0' )
		return SendClientMessage( playerid, COLOR_RED, "[ERRO] Use /v Nome" );

	idx = GetVehicleModelIDFromName(params,playerid);
	if(idx == 0)return 1;
	new
		Float:x,
		Float:y,
		Float:z,
		Float:a;

	GetPlayerPos(playerid, x, y, z);
	GetPlayerFacingAngle(playerid, a);

	if(curPlayerVehI[playerid] != -1)
		DestroyVehicle(curPlayerVehI[playerid]);
	curPlayerVehM[playerid] = idx;

	curPlayerVehI[playerid] = CreateVehicle(idx, x, y, z + 2.0, a + 90.0, -1, -1, 5000);
	LinkVehicleToInterior(curPlayerVehI[playerid], GetPlayerInterior(playerid));
	PutPlayerInVehicle(playerid,curPlayerVehI[playerid],0);

 	curServerVehP[curPlayerVehI[playerid]][spawn] 	= true;
	curServerVehP[curPlayerVehI[playerid]][vmodel]	= idx;
	curServerVehP[curPlayerVehI[playerid]][vInt]    = GetPlayerInterior(playerid);

	format(iString, 128, "[INFO]: \"%s\" criado com Sucesso.", aVehicleNames[idx - MIN_VEHI_ID]);

	SendClientMessage(playerid, COLOR_GREEN, iString);

	return true;
}
Vlw !!!


Re: [AJUDA] Criaзгo de veнculo! - Lуs - 02.01.2012

pawn Код:
if(idx == Hydra) return 1;



Re: [AJUDA] Criaзгo de veнculo! - danktog - 02.01.2012

C:\Documents and Settings\Daniel Silva\Desktop\FdS\filterscripts\FSV.pwn(295) : error 017: undefined symbol "Hydra"


Re: [AJUDA] Criaзгo de veнculo! - Lуs - 02.01.2012

pawn Код:
if(GetVehicleModelIDFromName(params,playerid) == "Hydra") return 1;
Se nгo der certo, tente sem aspas.


Re: [AJUDA] Criaзгo de veнculo! - [O.z]Caroline - 03.01.2012

pawn Код:
dcmd_v(playerid, params[])
{
    new
        idx = 0,
        iString[ 128 ];

    if ( params[ 0 ] == '\0' )
        return SendClientMessage( playerid, COLOR_RED, "[ERRO] Use /v Nome" );

    idx = GetVehicleModelIDFromName(params,playerid);
    if(idx == 0) return 1;
        if(idx == 520 || idx == 425) return SendClientMessage(playerid, -1, "Veнculo proibido."); // Aqui
    new
        Float:x,
        Float:y,
        Float:z,
        Float:a;

    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);

    if(curPlayerVehI[playerid] != -1)
        DestroyVehicle(curPlayerVehI[playerid]);
    curPlayerVehM[playerid] = idx;

    curPlayerVehI[playerid] = CreateVehicle(idx, x, y, z + 2.0, a + 90.0, -1, -1, 5000);
    LinkVehicleToInterior(curPlayerVehI[playerid], GetPlayerInterior(playerid));
    PutPlayerInVehicle(playerid,curPlayerVehI[playerid],0);

    curServerVehP[curPlayerVehI[playerid]][spawn]   = true;
    curServerVehP[curPlayerVehI[playerid]][vmodel]  = idx;
    curServerVehP[curPlayerVehI[playerid]][vInt]    = GetPlayerInterior(playerid);

    format(iString, 128, "[INFO]: \"%s\" criado com Sucesso.", aVehicleNames[idx - MIN_VEHI_ID]);

    SendClientMessage(playerid, COLOR_GREEN, iString);

    return true;
}

Coloquei para proibir Hunter e Hydra,
caso queira colocar mais, acesse: https://sampwiki.blast.hk/wiki/Vehicle_Model_ID_List


Espero ter ajudado :P


Re: [AJUDA] Criaзгo de veнculo! - danktog - 03.01.2012

Mais aн й pelo ID, nesse sistema ta o nome do carro!