star69 Posted April 26, 2016 Posted April 26, 2016 Incerc sa fac un job nou Cand intru in CP se creeaza un object in pozitia mea Quote if (APlayerData[playerid][JobStep] == 1) { if(IsPlayerInRangeOfPoint(playerid, 10, -46.6383,-108.1212,3.1172)) { new Float:X, Float:Y, Float:Z, Float:A; DisablePlayerCheckpoint(playerid); PlayerPlaySound(playerid,1136,0.0,0.0,0.0); GetPlayerPos(playerid, X, Y, Z); GetPlayerFacingAngle(playerid, A); Planta1 = CreateObject(813, X, Y, Z-1.0, A); } if (APlayerData[playerid][JobStep] == 2) { if(IsPlayerInRangeOfPoint(playerid, 10, -46.6383,-108.1212,3.1172)) { DisablePlayerCheckpoint(playerid); PlayerPlaySound(playerid,1136,0.0,0.0,0.0); SetPlayerCheckpoint(playerid,-34.9588,-69.0512,3.1172, 10); DestroyObject(Planta1); } Cum pot face la JobStep == 2 sa fie if(IsPlayerInRangeOfPoint(playerid, locatia la Planta1 ?
0 Mister Posted April 26, 2016 Posted April 26, 2016 (edited) New float:x , float:y ... Z GetObjectPos(plantat,x,y,z) IsPlayerInRangeOfPoint(playerid,2,x y z Sper ca înțelegi nu am dat mura în gură cauta pe wiki. Getobjectpos Edited April 26, 2016 by Mister 1 __ ____ __ / |/ (_)____/ /____ _____ / /|_/ / / ___/ __/ _ \/ ___/ / / / / (__ ) /_/ __/ / /_/ /_/_/____/\__/\___/_/ SERVICII SCRIPTING DE CALITATE Pagina Scripting pawn
0 star69 Posted April 26, 2016 Author Posted April 26, 2016 Am inteles. Multumesc! Ma mai poti ajuta cu ceva? DisablePlayerCheckpoint(playerid); PlayerPlaySound(playerid,1136,0.0,0.0,0.0); SetPlayerCheckpoint(playerid,-34.9588,-69.0512,3.1172, 10); DestroyObject(Planta1); new Float:X, Float:Y, Float:Z, Float:A; GetPlayerPos(playerid, X, Y, Z); GetPlayerFacingAngle(playerid, A); Balot1 = CreateObject(1454, X, Y, Z-1.3, 0.0, 0.0, A); Am dupa ce dispare planta1 sa apara objectul balot1 chestia e ca se creeaza exat unde e combina mea, vreau sa fie mai in spate Am incercat sa pun la Y -1.5 a functionat, dar daca vin din partea opusa se creeaza in fata mea Ai idee ce pot sa fac? sa se creeze intodeauna in spatele masinii ?
0 Mister Posted April 27, 2016 Posted April 27, 2016 (edited) Înlocuiesti getplayerpos cu. GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance) { new Float:a; GetPlayerPos(playerid, x, y, a); GetPlayerFacingAngle(playerid, a); if (GetPlayerVehicleID(playerid)) { GetVehicleZAngle(GetPlayerVehicleID(playerid), a); } x += (distance * floatsin(-a, degrees)); y += (distance * floatcos(-a, degrees)); } Și adăugă funcția asta la finalul gmului Edited April 27, 2016 by Mister __ ____ __ / |/ (_)____/ /____ _____ / /|_/ / / ___/ __/ _ \/ ___/ / / / / (__ ) /_/ __/ / /_/ /_/_/____/\__/\___/_/ SERVICII SCRIPTING DE CALITATE Pagina Scripting pawn
0 star69 Posted April 27, 2016 Author Posted April 27, 2016 (edited) 1 hour ago, Mister said: Înlocuiesti getplayerpos cu. GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance) { new Float:a; GetPlayerPos(playerid, x, y, a); GetPlayerFacingAngle(playerid, a); if (GetPlayerVehicleID(playerid)) { GetVehicleZAngle(GetPlayerVehicleID(playerid), a); } x += (distance * floatsin(-a, degrees)); y += (distance * floatcos(-a, degrees)); } Și adăugă funcția asta la finalul gmului A functionat, se creeaza in spate Cum pot face distanta mai mare sa fie mai in spate? Edited April 27, 2016 by star69
0 Mister Posted April 27, 2016 Posted April 27, 2016 Scrie în funcție ultima variabilă e distanta __ ____ __ / |/ (_)____/ /____ _____ / /|_/ / / ___/ __/ _ \/ ___/ / / / / (__ ) /_/ __/ / /_/ /_/_/____/\__/\___/_/ SERVICII SCRIPTING DE CALITATE Pagina Scripting pawn
Question
star69
Quote
Cum pot face la JobStep == 2 sa fie if(IsPlayerInRangeOfPoint(playerid, locatia la Planta1 ?
5 answers to this question
Recommended Posts