Jump to content
In legătură cu BAN-UL jucătorilor cu experiență !!! Read more... ×
  • Advertisments


Sign in to follow this  
DjAndy

Creatiile voastre

Recommended Posts

Dupa cum va spune titlul aici aflati cum puteti face o masina dupa placul vostru :)) ( si ca de obicei cu limita de obiecte )

DQCrY7A.png

Lista e deja familiara , diferite masini cu obiecte atasate de ele!

Ei , aici puteti face si voi lucru asta , dar trebuie sa aveti putina experienta in mapping(map editor) cat si in scripting :))

Deci fara prea multe introduceri , incepem cu map editor!

La inceput cand folosi map editor , cautati camera view , aia va teleporteaza la coordonatele dorite , oricum in cazul asta trebuie sa fim la coordonatele 0, 0, 0 care sunt setate by default

n7cFvG1.png

Bun , acuma selectati o suprafata si adaugati un obiect - cautati masini -> Lista: Vehicles

Dupa ce ati creat vehiculul selectati tabul movements si cautati tabul cu coordonate , acolo modificati coordonatele in 0, 0, 0 - dupa folositi camera view din tabul view pentru a fi teleportat la coordonatele 0, 0, 0 - in mod mai simplu , e fix sub pamant :))

4hTe41u.png

Daca ati ajuns pana aici , inseamna ca masina asa trebuie sa arate in map editor! :)

TCMgsqB.png

Acuma alegeti obiectele care sa fie atasate de masina , aici fiecare cu idei lui , ce fel de masina poate sa fie adaugata in categoria special vehicles de pe server :)

Daca nu vedeti bine culoare la masina , exista un button de carcolor , sa modificati culoarea masini ( din pacate nu puteti adauga obiecte in interiorul masinilor , cel putin in map editor , in editor in-game procedura trebuie sa fie similara , cu masina , dar nu stiu cum va fi mentinuta in aer masina :)))

Un simplu exemplar care l-am facut

lbm17CF.png

Partea usoara e termina , acuma urmeaza durerea de cap pentru multi , in scripting :))

Model:

#include <a_samp>
#include <streamer>
  
new current[MAX_PLAYERS];
new VehicleObject[10];
  
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/carname", cmdtext, true, 10) == 0)
	{
    if(IsPlayerInAnyVehicle(playerid)) { SetVehicleToRespawn(GetPlayerVehicleID(playerid));}
    new Float:Pos[4];
    current[playerid] = GetPlayerVehicleID(playerid);
    GetPlayerPos(playerid, Float:Pos[0], Float:Pos[1], Float:Pos[2]);
	GetPlayerFacingAngle(playerid, Float:Pos[3]);
    DestroyVehicle(current[playerid]);
 	DestroyDynamicObject(VehicleObject[0]);
	VehicleObject[0] = CreateDynamicObject(objectid, x, y, z,   rx, ry, rz0);
	current[playerid] = CreateVehicle(vehicleid, Float:Pos[0], Float:Pos[1], Float:Pos[2], Float:Pos[3], -1, -1, -1);
	AttachDynamicObjectToVehicle(VehicleObject[0], current[playerid], x, y, z,   rx, ry, rz);
	PutPlayerInVehicle(playerid, current[playerid], 0);
	return 1;
}
    return 0;
}

In model e doar un obiect , pentru mai multe obiecte adaugati VehicleObject[0] , VehicleObject[1] pana la 10 , daca aveti atatea obiecte :))

Bun , vehicleid = id-ul masini care sa fie , de exemplu infernus - 411, iar la finalul functiei CreateVehicle sunt 3 variabile toate cu -1 , primele 2 semnifica culoarea masini si al 3-lea timpul pana dispare vehiculul daca jucatorul nu se afla in masina , am setat pe -1 sa nu dispara niciodata :) 
VehicleObject[0] = obiectul care vreti sa fie creat , in map editor folositi show code pentru a afisa detalile legat de obiecte!

vvoKMYU.png

Copiati obiectul dorit si adaugatil dupa denumirea VehicleObject[0] = CreateDynamicObject(1163, -0.02, -2.35, 0.59,   0.00, 0.00, 0.00); <- exemplu

Acelasi lucru e cu mai multe obiecte , doar ca trebuie modificat denumirea VehicleObject[1] 2, 3, sau cate obiecte vreti :))

Bun , obiectele au fost create , acuma trebuie atasate de vehicul , aici este necesar coordonatele de la obiect -> X, Y, Z, Rx, Ry, Rz

AttachDynamicObjectToVehicle(VehicleObject[0], current[playerid], x, y, z,  rx, ry, rz);

AttachDynamicObjectToVehicle(VehicleObject[1], current[playerid], 0.51160, -0.11060, 0.08720,   90.00000, 25.00000, 92.00000);

Daca ati facut lucru asta , iar pawno-ul nu va da eroare la compile atunci bravo voua :)) ca ati reusit!

Ca bonus las cateva exemplare sa va uitati mai bine , daca nu ati inteles bine din ce am zis mai sus :))

#include <a_samp>
#include <streamer>

new current[MAX_PLAYERS];
new VehicleObject[30];

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/vheli", cmdtext, true, 10) == 0)
	{
	if(IsPlayerInAnyVehicle(playerid)) { SetVehicleToRespawn(GetPlayerVehicleID(playerid));}
    new Float:Pos[4];
    current[playerid] = GetPlayerVehicleID(playerid);
	DestroyVehicle(current[playerid]);
 	DestroyDynamicObject(VehicleObject[0]);
 	DestroyDynamicObject(VehicleObject[1]);
 	DestroyDynamicObject(VehicleObject[2]);
 	DestroyDynamicObject(VehicleObject[3]);
 	DestroyDynamicObject(VehicleObject[4]);
 	DestroyDynamicObject(VehicleObject[5]);
 	DestroyDynamicObject(VehicleObject[6]);
	GetPlayerPos(playerid, Float:Pos[0], Float:Pos[1], Float:Pos[2]);
	GetPlayerFacingAngle(playerid, Float:Pos[3]);
	VehicleObject[0] = CreateDynamicObject(18646, -0.00799, 1.51638, 1.22359,   0.00000, 0.00000, 0.00000);
	VehicleObject[1] = CreateDynamicObject(2985, -0.99086, 2.07330, -0.90127,   0.00000, 0.00000, 90.00000);
	VehicleObject[2] = CreateDynamicObject(2985, 1.02090, 2.07330, -0.90130,   0.00000, 0.00000, 90.00000);
	VehicleObject[3] = CreateDynamicObject(18647, -1.04452, 0.13858, -0.72245,   0.00000, 0.00000, 0.00000);
	VehicleObject[4] = CreateDynamicObject(18647, 1.02090, 0.13860, -0.72250,   0.00000, 0.00000, 0.00000);
	VehicleObject[5] = CreateDynamicObject(3790, 0.22130, 0.89800, -0.61360,   0.00000, 0.00000, -90.00000);
	VehicleObject[6] = CreateDynamicObject(3790, -0.12130, 0.89800, -0.61360,   0.00000, 0.00000, -90.00000);
	current[playerid] = CreateVehicle(447, Float:Pos[0], Float:Pos[1], Float:Pos[2], Float:Pos[3], -1, -1, 10);
	AttachDynamicObjectToVehicle(VehicleObject[0], current[playerid], -0.00799, 1.51638, 1.22359,   0.00000, 0.00000, 0.00000);
	AttachDynamicObjectToVehicle(VehicleObject[1], current[playerid], -0.99086, 2.07330, -0.90127,   0.00000, 0.00000, 90.00000);
	AttachDynamicObjectToVehicle(VehicleObject[2], current[playerid], 1.02090, 2.07330, -0.90130,   0.00000, 0.00000, 90.00000);
	AttachDynamicObjectToVehicle(VehicleObject[3], current[playerid], -1.04452, 0.13858, -0.72245,   0.00000, 0.00000, 0.00000);
	AttachDynamicObjectToVehicle(VehicleObject[4], current[playerid], 1.02090, 0.13860, -0.72250,   0.00000, 0.00000, 0.00000);
	AttachDynamicObjectToVehicle(VehicleObject[5], current[playerid], 0.22130, 0.89800, -0.61360,   0.00000, 0.00000, -90.00000);
	AttachDynamicObjectToVehicle(VehicleObject[6], current[playerid], -0.12130, 0.89800, -0.61360,   0.00000, 0.00000, -90.00000);
	PutPlayerInVehicle(playerid, current[playerid], 0);
	return 1;
}
    if (strcmp("/monster", cmdtext, true, 10) == 0)
	{
    if(IsPlayerInAnyVehicle(playerid)) { SetVehicleToRespawn(GetPlayerVehicleID(playerid));}
    new Float:Pos[4];
    current[playerid] = GetPlayerVehicleID(playerid);
    DestroyVehicle(current[playerid]);
 	DestroyDynamicObject(VehicleObject[10]);
 	DestroyDynamicObject(VehicleObject[11]);
 	DestroyDynamicObject(VehicleObject[12]);
 	DestroyDynamicObject(VehicleObject[13]);
 	DestroyDynamicObject(VehicleObject[14]);
 	DestroyDynamicObject(VehicleObject[15]);
	GetPlayerPos(playerid, Float:Pos[0], Float:Pos[1], Float:Pos[2]);
	GetPlayerFacingAngle(playerid, Float:Pos[3]);
	VehicleObject[10] = CreateDynamicObject(18646, 1.19703, -4.03367, 1.10494,   0.00000, 0.00000, 0.00000);
	VehicleObject[11] = CreateDynamicObject(2985, 1.70940, 2.75390, -0.23220,   0.00000, 0.00000, 90.00000);
	VehicleObject[12] = CreateDynamicObject(2985, -1.64940, 2.75390, -0.23220,   0.00000, 0.00000, 90.00000);
	VehicleObject[13] = CreateDynamicObject(18848, -0.00584, -1.16545, 1.22986,   0.00000, 0.00000, 0.00000);
	VehicleObject[14] = CreateDynamicObject(18647, -0.00761, 3.95995, -0.16300,   0.00000, 0.00000, 90.00000);
	VehicleObject[15] = CreateDynamicObject(18648, -0.02175, -3.80612, -0.16300,   0.00000, 0.00000, 90.00000);
	current[playerid] = CreateVehicle(432, Float:Pos[0], Float:Pos[1], Float:Pos[2], Float:Pos[3], -1, -1, 10);
	AttachDynamicObjectToVehicle(VehicleObject[10], current[playerid], 1.19703, -4.03367, 1.10494,   0.00000, 0.00000, 0.00000);
	AttachDynamicObjectToVehicle(VehicleObject[11], current[playerid], 1.70940, 2.75390, -0.23220,   0.00000, 0.00000, 90.00000);
	AttachDynamicObjectToVehicle(VehicleObject[12], current[playerid], -1.64940, 2.75390, -0.23220,   0.00000, 0.00000, 90.00000);
	AttachDynamicObjectToVehicle(VehicleObject[13], current[playerid], -0.00584, -1.16545, 1.22986,   0.00000, 0.00000, 0.00000);
	AttachDynamicObjectToVehicle(VehicleObject[14], current[playerid], -0.00761, 3.95995, -0.16300,   0.00000, 0.00000, 90.00000);
	AttachDynamicObjectToVehicle(VehicleObject[15], current[playerid], -0.02175, -3.80612, -0.16300,   0.00000, 0.00000, 90.00000);
	PutPlayerInVehicle(playerid, current[playerid], 0);
	return 1;
}
    if (strcmp("/vbike", cmdtext, true, 10) == 0)
	{
    if(IsPlayerInAnyVehicle(playerid)) { SetVehicleToRespawn(GetPlayerVehicleID(playerid));}
    new Float:Pos[4];
    current[playerid] = GetPlayerVehicleID(playerid);
    GetPlayerPos(playerid, Float:Pos[0], Float:Pos[1], Float:Pos[2]);
	GetPlayerFacingAngle(playerid, Float:Pos[3]);
    DestroyVehicle(current[playerid]);
 	DestroyDynamicObject(VehicleObject[20]);
 	DestroyDynamicObject(VehicleObject[21]);
 	DestroyDynamicObject(VehicleObject[22]);
	VehicleObject[20] = CreateDynamicObject(362, 0.51160, -0.11060, 0.08720,   90.00000, 25.00000, 92.00000);
	VehicleObject[21] = CreateDynamicObject(362, -0.56768, -0.10967, 0.15992,   -96.00000, -88.00000, -29.00000);
	VehicleObject[22] = CreateDynamicObject(18646, 0.00575, -1.01237, 0.65942,   0.00000, 0.00000, 0.00000);
	current[playerid] = CreateVehicle(522, Float:Pos[0], Float:Pos[1], Float:Pos[2], Float:Pos[3], 1, 0, -1);
	AttachDynamicObjectToVehicle(VehicleObject[20], current[playerid], 0.51160, -0.11060, 0.08720,   90.00000, 25.00000, 92.00000);
	AttachDynamicObjectToVehicle(VehicleObject[21], current[playerid], -0.56768, -0.10967, 0.15992,   -96.00000, -88.00000, -29.00000);
	AttachDynamicObjectToVehicle(VehicleObject[22], current[playerid], 0.00575, -1.01237, 0.65942,   0.00000, 0.00000, 0.00000);
	PutPlayerInVehicle(playerid, current[playerid], 0);
	return 1;
}
	return 0;
}

Rezultatul

G9ZCOnM.png

DUY61SI.png

BMOT9zT.png

:)

Download: - Server
                   - Plugin

Edited by [esu.familia]robbO
  • Like 7

Share this post


Link to post
Share on other sites

Unde vreți , daca e prea complicat , doar îmi dați obiectele/mașina pe pastebin , și eu le fac în script , după le puteți testa și pe server :)

Pe vitor poate am sa fac un editor pentru asa ceva :))

Dar momentan cu map editor

ON:

RXSztDL.png

sTNJWUQ.png

7ayScJd.png

😎

Code:

#include <a_samp>
#include <streamer>
  
new current[MAX_PLAYERS];
new VehicleObject[40];

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycar", cmdtext, true, 10) == 0)
	{
	if(IsPlayerInAnyVehicle(playerid)) { SetVehicleToRespawn(GetPlayerVehicleID(playerid));}
    new Float:Pos[4];
    current[playerid] = GetPlayerVehicleID(playerid);
	DestroyVehicle(current[playerid]);
 	DestroyDynamicObject(VehicleObject[30]);
 	DestroyDynamicObject(VehicleObject[31]);
 	DestroyDynamicObject(VehicleObject[32]);
 	DestroyDynamicObject(VehicleObject[33]);
 	DestroyDynamicObject(VehicleObject[34]);
 	DestroyDynamicObject(VehicleObject[35]);
 	DestroyDynamicObject(VehicleObject[36]);
	GetPlayerPos(playerid, Float:Pos[0], Float:Pos[1], Float:Pos[2]);
	GetPlayerFacingAngle(playerid, Float:Pos[3]);
	VehicleObject[30] = CreateDynamicObject(1163, -0.0156, -2.4535, 0.4937, 0.0000, 0.0000, -0.6815);
	VehicleObject[31] = CreateDynamicObject(18631, -0.0792, -0.1420, 0.6832, -90.2000, -100.7998, 77.8264);
	VehicleObject[32] = CreateDynamicObject(19476, -0.0040, 0.3977, 0.6313, 0.0000, -84.0998, 90);
	VehicleObject[33] = CreateDynamicObject(19477, -0.0079, 1.9372, 0.1521, -0.1000, -80.6001, 90);
	VehicleObject[34] = CreateDynamicObject(19477, -1.0926, 0.1132, -0.1175, 0.0000, 0.0000, -179);
	VehicleObject[35] = CreateDynamicObject(19477, 1.0855, 0.1673, -0.1175, 0.0000, 0.0000, -1);
	VehicleObject[36] = CreateDynamicObject(19477, -0.0035, -1.7757, 0.2622, 0.0000, -87.3997, -90);
	current[playerid] = CreateVehicle(411, Float:Pos[0], Float:Pos[1], Float:Pos[2], Float:Pos[3], 1, 1, 10);
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	SetDynamicObjectMaterialText(VehicleObject[32], 0, "King: ERROR 0, 0", 130, "Georgia", 60, 1, 0xFFFF0000, 0x0, 1);
	SetDynamicObjectMaterialText(VehicleObject[33], 0, "{00FF00}Radio{005AFF}R{FFFF00}S{FF0000}S\n{005AFF}DJ", 130, "Georgia", 50, 1, 0xFFFF0000, 0x0, 1);
	SetDynamicObjectMaterialText(VehicleObject[34], 0, "{FF9933}Scripter {00FFFF}& {00FF00}Mapper", 130, "Georgia", 50, 1, 0xFFFF0000, 0x0, 1);
    SetDynamicObjectMaterialText(VehicleObject[35], 0, "{FF0000}General {00FFFF}& {FF0000}({FFFFFF}RCON{FF0000})", 130, "Georgia", 50, 1, 0xFFFF0000, 0x0, 1);
    SetDynamicObjectMaterialText(VehicleObject[36], 0, "{005AFF}DjAndy{FF0000}(King)", 130, "Georgia", 50, 1, 0xFFFF0000, 0x0, 1);
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	AttachDynamicObjectToVehicle(VehicleObject[30], current[playerid], -0.0156, -2.4535, 0.4937, 0.0000, 0.0000, -0.6815);
	AttachDynamicObjectToVehicle(VehicleObject[31], current[playerid], -0.0792, -0.1420, 0.6832, -90.2000, -100.7998, 77.8264);
	AttachDynamicObjectToVehicle(VehicleObject[32], current[playerid], -0.0040, 0.3977, 0.6413, 0.0000, -84.0998, 90);
	AttachDynamicObjectToVehicle(VehicleObject[33], current[playerid], -0.0079, 1.9372, 0.1521, -0.1000, -80.6001, 90);
	AttachDynamicObjectToVehicle(VehicleObject[34], current[playerid], -1.0926, 0.1132, -0.1175, 0.0000, 0.0000, -179);
	AttachDynamicObjectToVehicle(VehicleObject[35], current[playerid], 1.0855, 0.1673, -0.1175, 0.0000, 0.0000, -1);
	AttachDynamicObjectToVehicle(VehicleObject[36], current[playerid], -0.0035, -1.7757, 0.2622, 0.0000, -87.3997, -90);
	PutPlayerInVehicle(playerid, current[playerid], 0);
	return 1;
}
	return 0;
}

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×