19.01.2013, 19:50
[TUTORIAL] Como ADD Carros Para Org Do Server RPG [TUTORIAL]
Bom Vamos Comeзar
Primeiramente Topo
pawn Код:
forward IsASuaOrg(playerid);
forward IsASuaOrgCar(carid);
Crie Isso
pawn Код:
if(IsASuaOrgCar(vehicleid) && !ispassenger)//Lembre-se Mesma Coisa que vc escreveu na forward
{
if(!IsASuaOrg(playerid))
{
SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й Da Org Tal Tal!");
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
}
}
pawn Код:
public OnPlayerConnect
for(new x = 1; x <= MAX_VEHICLES; x++)
{
if(IsASuaOrgCar(x))
{
SetVehicleNumberPlate(x, "{1E90FF}Nome Org");
}
}
pawn Код:
public IsASuaOrg(playerid)
{
if(IsPlayerConnected(playerid))
{
new lider = PlayerInfo[playerid][pLider];
new member = PlayerInfo[playerid][pMembro];
if(member==iddaorg || member==iddaorg)
{
return 1;
}
else if(lider==iddaorg || lider==iddaorg)
{
return 1;
}
}
return 0;
}
//Se Quiser Colocar Abaixo Disso Ja Coloque isso //
public IsASuaOrgCar(carid)
{
if((carid >= IdDosCarros) && (carid <= IdDosCarros) || (carid == IdDosCarros) || (carid == IdDosCarros))
{
return 1;
}
return 0;
}
Vamos Colocar os Carros No GameMode
Procura Por AddStaticVehicleEx E Coloque Por Baixo De Todos Os Carros Para Nгo Dar Bug Nos Ids
pawn Код:
AddStaticVehicleEx(601,-524.6410,-472.8258,25.2881,183.4395,0,6,60000*RESPAWN_TIME); // CARRO PF1 [456]
AddStaticVehicleEx(528,-519.6420,-472.6649,25.5781,180.2912,0,6,60000*RESPAWN_TIME); // CARRO PF2 [457]
AddStaticVehicleEx(598,-479.2738,-472.9961,25.2762,179.1194,0,6,60000*RESPAWN_TIME); // CARRO PF3 [458]
AddStaticVehicleEx(598,-474.0335,-473.0156,25.2835,178.7196,0,6,60000*RESPAWN_TIME); // CARRO PF4 [459]
AddStaticVehicleEx(523,-467.2058,-503.1348,25.0780,86.7181,0,6,60000*RESPAWN_TIME); // moto PF1 [460]
AddStaticVehicleEx(523,-467.2025,-501.3653,25.0803,88.6242,0,6,60000*RESPAWN_TIME); // moto PF2 [461]
AddStaticVehicleEx(523,-467.2528,-504.9776,25.0571,78.6762,0,6,60000*RESPAWN_TIME); // moto PF3 [462]
AddStaticVehicleEx(490,-494.4342,-472.2443,25.6488,178.3937,0,6,60000*RESPAWN_TIME); // CARRO PF5 [463]
AddStaticVehicleEx(427,-539.5823,-473.0930,25.6893,177.8778,0,6,60000*RESPAWN_TIME); // CARRO PF6 [464]
AddStaticVehicleEx(497,-604.7039,-475.4040,25.7380,271.1672,0,6,60000*RESPAWN_TIME); // heli PF1 [465]
AddStaticVehicleEx(528,-514.5025,-472.7819,25.5689,180.0707,0,6,60000*RESPAWN_TIME); // CARRO PF7 [466]
AddStaticVehicleEx(490,-499.5060,-471.9969,25.6548,179.2666,0,6,60000*RESPAWN_TIME); // CARRO PF8 [467]
AddStaticVehicleEx(528,-529.6046,-472.5577,25.5718,180.1069,116,116,60000*RESPAWN_TIME); // CARRO PF9 [468]
AddStaticVehicleEx(528,-534.4102,-473.0138,25.5867,180.4239,116,116,60000*RESPAWN_TIME);// CARRO PF10 [469]
pawn Код:
#define CAR_AMOUNT // O Meu Ta DE Total 1013 o De Vcs Vai Tar Diferente
O Meu Ficou
#define CAR_AMOUNT 1027
#define totalveiculos 650 // Carros Normais
#define totalveiculosh 651 // Carros Normais
#define totalveiculosc 891 // Carros Normais + CARROS DAS CASAS/990
Depois Faзa A Mesma Coisa Com Isso
e Adicione Na Public IsASuaOrgCar(carid)
Bom й Isso Vc Ja Consegue Criar Os Carros Da Sua Org De Boa