PDA

View Full Version : [Pomoc] Trailer Respawn


ZmaXy
11/01/2011, 03:30 PM
Kako da respawnam Trailer(prikolicu) tj nesto sto je zakaceno za prvo vozilo..

Eto npr: Radim posao Kamiondzije i sad kad dodje do zadnjeg CPa ja sam napravio da mu se Respawna kamion ali nzm kako za prikolicu ?

Miralem
11/01/2011, 03:48 PM
Neznam dali ima funkcija " OnVehicleRespawn " ili " RespawnVehicle " , ako da .. Onda
Pod OnGameModeInit :
kamion = CreateVehicle......
prikolica = CreateVehicle...

Pod OnVehicleRespawn :
OnVehicleRespawn
if vehicle == kamion
RespawnVehicle(prikolica,true)

NEZNAM dali je ovo tačno ali ovako nešto bi trebalo da bude :P

ZmaXy
11/01/2011, 04:36 PM
Aj sacekacu ako jos neko odgovori,pa cemo videti..Mada nije mi bas jasno to tvoje :D

MicroD
11/01/2011, 04:50 PM
new prikolica;
prikolica = CreateVehicle
SetVehicleToRespawn(prikolica);

To kad ti udje u CP a ovo sto je naveo Miralem nepostoji xD

ZmaXy
11/01/2011, 06:32 PM
Hvala Davide :D


A kako onda npr kad Auto Servis zakaci auto pa ga odvede do CPa,kako taj auto da se respawna? Ovo za kamiondziju mi je sve jasno ;) Jos samo ovo ako moze...

MicroD
11/01/2011, 06:48 PM
Trebao bi mi onda tvoj kod za kacenje :)

ZmaXy
11/01/2011, 09:24 PM
if(strcmp(cmd,"/odvuci",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] == 7)
{
if(IsPlayerInAnyVehicle(playerid))
{
if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 525)
{
if(GetPlayerState(playerid)==2)
{
new Float:pX,Float:pY,Float:pZ;
GetPlayerPos(playerid,pX,pY,pZ);
new Float:vX,Float:vY,Float:vZ;
new Found=0;
new vid=0;
while((vid<MAX_VEHICLES)&&(!Found))
{
vid++;
GetVehiclePos(vid,vX,vY,vZ);
if ((floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
{
Found=1;
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(p layerid)))
{
DetachTrailerFromVehicle(GetPlayerVehicleID(player id));
}
else
{
AttachTrailerToVehicle(vid,GetPlayerVehicleID(play erid));
SendClientMessage(playerid, COLOR_DBLUE, "Odvezi auto do CheckPointa");
CP[giveplayerid] = 14000;
SetPlayerCheckpoint(giveplayerid, 1041.0383,-1095.2030,23.8281,8.0);
}
}
}
if(!Found)
{
SendClientMessage(playerid,SVETLOPLAVA,"Nisi dovoljno blizu auta");
}
}
else
{
SendClientMessage(playerid, SVETLOPLAVA, "Niste u vozilu");
return 1;
}
}
else
{
SendClientMessage(playerid, SVETLOPLAVA, "Niste u autu od Mehanicara");
return 1;
}
}
else
{
SendClientMessage(playerid, SVETLOPLAVA, "Niste u vozilu");
return 1;
}
}
else
{
SendClientMessage(playerid,SVETLOPLAVA,"Niste Mehanicar");
return 1;
}
}
return 1;
}

Hvala ti ! :cool:

ZmaXy
14/01/2011, 12:05 AM
Oces li pomoci ?

MicroD
27/01/2011, 09:13 PM
Treba mi to kod cp(kad dodje) ne cmd sory...

ZmaXy
27/01/2011, 09:35 PM
Evo ga :
:)
else if(CP[playerid] == 14001)
{
CP[playerid] = 0;
DisablePlayerCheckpoint(playerid);
JB_GivePlayerMoney(playerid, 50);
SendClientMessage(playerid,SVETLOPLAVA,"===========================");
SendClientMessage(playerid,SVETLOPLAVA,"Odlozio si auto i dobio 50$");
SendClientMessage(playerid,SVETLOPLAVA,"===========================");
GetPlayerName(playerid, name, sizeof(name));
}

MicroD
28/01/2011, 12:35 PM
else if(CP[playerid] == 14001)
{
if(IsTrailerAttachedToVehicle(vehicleid))
{
SetVehicleToRespawn(vehicleid);
}
CP[playerid] = 0;
DisablePlayerCheckpoint(playerid);
JB_GivePlayerMoney(playerid, 50);
SendClientMessage(playerid,SVETLOPLAVA,"===========================");
SendClientMessage(playerid,SVETLOPLAVA,"Odlozio si auto i dobio 50$");
SendClientMessage(playerid,SVETLOPLAVA,"===========================");
GetPlayerName(playerid, name, sizeof(name));
}

ZmaXy
29/01/2011, 01:39 PM
Thanks very much :D

MicroD
29/01/2011, 01:44 PM
Jel radi?

ZmaXy
29/01/2011, 01:52 PM
Nisam testao haha :D Javicu ti

ZmaXy
29/01/2011, 03:11 PM
Ima problem :(

Kada dodje na CP respawnuje se moje vozilo a to zakaceno ostane...?