[Pomoc] Setplayervehiclepos

Započeo [G-Unit] Mich, April 06, 2011, 19:05:29 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:Cyber
Detaljan opis problema:ovako ako mi mozete sam ubacit u ovu komandu /port da se portam sa vozilom jer nisam postavio a ovak se portam samo ovak bez vozila:
evo dio komande mislim da u taj dio treba ici
CMD:port(playerid,params[])
{
if(PlayerInfo[playerid][Admin] < 1 && PlayerInfo[playerid][pGameMaster] < 1) return SendClientMessage(playerid,COLOR_GRAD2,"(greska) Niste ovlasteni za koristenje ove komande!");
new lokacija;
if(sscanf(params,"i",lokacija)) return SendClientMessage(playerid,COLOR_LIGHTBLUE,"Koristite: /port [Broj Lokacije]");
Dio skripte://
Neke slike/video za lakse dobivanje pomoci(neobavezno)://

dragan12

A na koje kordinate da se porta?
Evo pa ti doradi

new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, x,y,z);//Ti zameni sa kordinatama
Tako bi trebalo jos mozes dodati ispod
            SetPlayerInterior(playerid,0);
            PlayerInfo[playerid][pInt] = 0;
             SetPlayerVirtualWorld(playerid, 0);
              PlayerInfo[playerid][pVirWorld] = 0;
Poslednja Izmena: April 06, 2011, 19:14:01 POSLE PODNE od Gagi_Corleone

imam 23 pozicije u /port evo komande:

CMD:port(playerid,params[])
{
if(PlayerInfo[playerid][Admin] < 1 && PlayerInfo[playerid][pGameMaster] < 1) return SendClientMessage(playerid,COLOR_GRAD2,"(greska) Niste ovlasteni za koristenje ove komande!");
new lokacija;
if(sscanf(params,"i",lokacija)) return SendClientMessage(playerid,COLOR_LIGHTBLUE,"Koristite: /port [Broj Lokacije]");
SendClientMessage(playerid,COLOR_WHITE,"|_______________________________ Dostupne Lokacije: ______________________________________________________|");
SendClientMessage(playerid,COLOR_WHITE,"1: Spawn | 2: Burg | 3: Los Santos | 4: Las Venturas | 5: Beach Hell Race | 6: Cross Race");
SendClientMessage(playerid,COLOR_WHITE,"7: Aerodrom | 8: San Fiero | 9: Banka | 10: Monster Race | 11: Vijecnica | 12: Bolnica | 13: Ammu Nation");
SendClientMessage(playerid,COLOR_WHITE,"14: Mehanicar | 15: Vozac Busa | 16: Farmer | 17: Grove Street | 18: Diler Droge | 19: Diler Oruzja | 20: Dealership");
SendClientMessage(playerid,COLOR_WHITE,"21: Tour LC | 22: Big Race | 23: Area");
SendClientMessage(playerid,COLOR_WHITE,"|__________________________________________________________________________________________________________|");
if(lokacija < 1 || lokacija > 23) return SendClientMessage(playerid,COLOR_WHITE,"Lokacija mora biti vece od 0 i manje od 24");
if(lokacija == 1) SetPlayerPos(playerid, 1726.4761,-1911.6243,13.5638);
if(lokacija == 2) SetPlayerPos(playerid, 1206.4596,-920.4810,43.0614);
if(lokacija == 3) SetPlayerPos(playerid, 1531.3563,-1684.6602,13.3828);
if(lokacija == 4) SetPlayerPos(playerid, 1699.2000,1435.1000,10.7023);
if(lokacija == 5) SetPlayerPos(playerid, -2954.1628,467.5646,4.9141);
if(lokacija == 6) SetPlayerPos(playerid, -2372.4692,-2180.5386,33.4446);
if(lokacija == 7) SetPlayerPos(playerid, 1958.5256,-2173.6965,13.4605);
if(lokacija == 8) SetPlayerPos(playerid, -1417.0000,-295.8000,14.1484);
if(lokacija == 9) SetPlayerPos(playerid, 1446.2181,-1040.6604,23.8281);
if(lokacija == 10) SetPlayerPos(playerid, 260.5661,2857.4243,19.0201);
if(lokacija == 11) SetPlayerPos(playerid, 1480.2969,-1765.5702,18.7958);
if(lokacija == 12) SetPlayerPos(playerid, 1187.1552,-1307.8126,13.5625);
if(lokacija == 13) SetPlayerPos(playerid, 1364.7120,-1279.8381,13.5469);
if(lokacija == 14) SetPlayerPos(playerid, 999.7120,-1090.5604,23.3804);
if(lokacija == 15) SetPlayerPos(playerid, 1155.5750,-1758.4124,13.2397);
if(lokacija == 16) SetPlayerPos(playerid, -382.9712,-1399.9471,23.8356);
if(lokacija == 17) SetPlayerPos(playerid, 2481.8582,-1664.5009,13.3394);
if(lokacija == 18) SetPlayerPos(playerid, 1299.7886,-1245.0042,13.5469);
if(lokacija == 19) SetPlayerPos(playerid, 1421.7458,-1298.9548,13.5547);
if(lokacija == 20) SetPlayerPos(playerid, 558.9409,-1251.3082,17.1620);
if(lokacija == 21) SetPlayerPos(playerid, 2846.5303,-1888.1145,10.4975);
if(lokacija == 22) SetPlayerPos(playerid, -546.2229,2569.1580,53.0891);
if(lokacija == 23) SetPlayerPos(playerid, 146.6792,1917.1593,18.9640);


new tring[64];
format(tring,sizeof tring,"Teleportovani  ste na lokaciju: %d",lokacija);
SendClientMessage(playerid,COLOR_GRAD2,tring);
return 1;
}
pokusavao sam da ubacim ali nije islo xD

dragan12

CMD:port(playerid,params[])
{
if(PlayerInfo[playerid][Admin] < 1 && PlayerInfo[playerid][pGameMaster] < 1) return SendClientMessage(playerid,COLOR_GRAD2,"(greska) Niste ovlasteni za koristenje ove komande!");
new lokacija;
new tmpcar = GetPlayerVehicleID(playerid);
if(sscanf(params,"i",lokacija)) return SendClientMessage(playerid,COLOR_LIGHTBLUE,"Koristite: /port [Broj Lokacije]");
SendClientMessage(playerid,COLOR_WHITE,"|_______________________________ Dostupne Lokacije: ______________________________________________________|");
SendClientMessage(playerid,COLOR_WHITE,"1: Spawn | 2: Burg | 3: Los Santos | 4: Las Venturas | 5: Beach Hell Race | 6: Cross Race");
SendClientMessage(playerid,COLOR_WHITE,"7: Aerodrom | 8: San Fiero | 9: Banka | 10: Monster Race | 11: Vijecnica | 12: Bolnica | 13: Ammu Nation");
SendClientMessage(playerid,COLOR_WHITE,"14: Mehanicar | 15: Vozac Busa | 16: Farmer | 17: Grove Street | 18: Diler Droge | 19: Diler Oruzja | 20: Dealership");
SendClientMessage(playerid,COLOR_WHITE,"21: Tour LC | 22: Big Race | 23: Area");
SendClientMessage(playerid,COLOR_WHITE,"|__________________________________________________________________________________________________________|");
if(lokacija < 1 || lokacija > 23) return SendClientMessage(playerid,COLOR_WHITE,"Lokacija mora biti vece od 0 i manje od 24");
if(lokacija == 1) SetPlayerPos(playerid, 1726.4761,-1911.6243,13.5638);SetVehiclePos(tmpcar, 1726.4761,-1911.6243,13.5638);
if(lokacija == 2) SetPlayerPos(playerid, 1206.4596,-920.4810,43.0614);
if(lokacija == 3) SetPlayerPos(playerid, 1531.3563,-1684.6602,13.3828);
if(lokacija == 4) SetPlayerPos(playerid, 1699.2000,1435.1000,10.7023);
if(lokacija == 5) SetPlayerPos(playerid, -2954.1628,467.5646,4.9141);
if(lokacija == 6) SetPlayerPos(playerid, -2372.4692,-2180.5386,33.4446);
if(lokacija == 7) SetPlayerPos(playerid, 1958.5256,-2173.6965,13.4605);
if(lokacija ==  SetPlayerPos(playerid, -1417.0000,-295.8000,14.1484);
if(lokacija == 9) SetPlayerPos(playerid, 1446.2181,-1040.6604,23.8281);
if(lokacija == 10) SetPlayerPos(playerid, 260.5661,2857.4243,19.0201);
if(lokacija == 11) SetPlayerPos(playerid, 1480.2969,-1765.5702,18.7958);
if(lokacija == 12) SetPlayerPos(playerid, 1187.1552,-1307.8126,13.5625);
if(lokacija == 13) SetPlayerPos(playerid, 1364.7120,-1279.8381,13.5469);
if(lokacija == 14) SetPlayerPos(playerid, 999.7120,-1090.5604,23.3804);
if(lokacija == 15) SetPlayerPos(playerid, 1155.5750,-1758.4124,13.2397);
if(lokacija == 16) SetPlayerPos(playerid, -382.9712,-1399.9471,23.8356);
if(lokacija == 17) SetPlayerPos(playerid, 2481.8582,-1664.5009,13.3394);
if(lokacija == 18) SetPlayerPos(playerid, 1299.7886,-1245.0042,13.5469);
if(lokacija == 19) SetPlayerPos(playerid, 1421.7458,-1298.9548,13.5547);
if(lokacija == 20) SetPlayerPos(playerid, 558.9409,-1251.3082,17.1620);
if(lokacija == 21) SetPlayerPos(playerid, 2846.5303,-1888.1145,10.4975);
if(lokacija == 22) SetPlayerPos(playerid, -546.2229,2569.1580,53.0891);
if(lokacija == 23) SetPlayerPos(playerid, 146.6792,1917.1593,18.9640);


new tring[64];
format(tring,sizeof tring,"Teleportovani  ste na lokaciju: %d",lokacija);
SendClientMessage(playerid,COLOR_GRAD2,tring);
return 1;
}

pokusavao sam da ubacim ali nije islo xD


Probaj tako za taj prvi pa ako hoce dodaj i ostale tako

stock NovaPozicija(playerid,bool:WithVehicle,Float:x,Float:y,Float:z,Float:rot) //stock SetPlayerPosEx(playerid,bool:WithVehicle,Float:x,Float:y,Float:z,Float:rot)
{
     //by BloodMaster
if(WithVehicle == true && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new bu = GetPlayerVehicleID(playerid);
SetVehiclePos(bu,x,y,z);
SetVehicleZAngle(bu,rot);
PutPlayerInVehicle(playerid,bu,0);
return 1;
}
else
{
SetPlayerPos(playerid,x,y,z);
SetPlayerFacingAngle(playerid,rot);
return 1;
}
return 1;
}


Evo da razjasnim:

playerid - Id Igraca koji se teleporta
WithVehicle - Ukoliko je igrac u vozilu, dali ce se i to vozilo portati (true = hoce, false = nece)
x,y,z - Koordinate porta
rot - Rotacija

NPR:


NovaPozicija(playerid,true,5000.56,1005.55,111.5,90);

Ako nije jasno, pitajte na PM pa cu razjasnit ovdje....

gagi porta me sa vozilom ali stojim na vozilu kad me porta kak da napravim da mi sjedi kad se portam?

Uzeto iz GF moda

       new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, 2368.6777,-1329.0420,23.6027);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
SetPlayerInterior(playerid, 0);


Radi 100% za svaku port lokaciju, samo promjeni u  SetVehiclePos(tmpcar, 2368.6777,-1329.0420,23.6027); tvoje X,Y,Z

edit: I koristi else if u vezivanju visestrukih if grananja.
Poslednja Izmena: April 06, 2011, 22:19:50 POSLE PODNE od bake_pg

dragan12

Citat: bake_pg poslato April 06, 2011, 22:16:20 POSLE PODNE
Uzeto iz GF moda

        new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, 2368.6777,-1329.0420,23.6027);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
SetPlayerInterior(playerid, 0);


Radi 100% za svaku port lokaciju, samo promjeni u  SetVehiclePos(tmpcar, 2368.6777,-1329.0420,23.6027); tvoje X,Y,Z
To sam mu ja pre par sekundi posalo u poruci  :)

ubacio sam ali nista portam se opet sa vozilom ali na njemu tj stojim na sjedalu kad se portam

Dodaj:


PutPlayerInVehicle(playerid, tmpcar, 0);

Last nick: Paradox