bogdaNNNNN Posted February 15, 2018 Report Share Posted February 15, 2018 Salut, am facut aceasta comanda, dar ma teleporteaza doar pe mine.. cum fac sa teleporteze si alti playeri la acele Coordonate? Citat CMD:dmv(playerid, params[]){ if(PlayerInfo[playerid][pAdmin] < 1 || PlayerInfo[playerid][pHelper] < 3) return SendClientMessage(playerid, COLOR_WHITE,AdminOnly); new string[250]; new id; if(sscanf(params, "fff")) return SendClientMessage(playerid, -1, "USAGE: /dmv <id>"); if(IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),1218.9750,-1812.7285,16.5938); if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) SetPlayerPos(playerid, 1218.9750,-1812.7285,16.5938); SetPlayerInterior(playerid,0); return 1; } Quote Link to comment Share on other sites More sharing options...
0 AlwaysGoLl Posted February 15, 2018 Report Share Posted February 15, 2018 Nu inteleg ce vrei sa spui cu dmv? Quote Link to comment Share on other sites More sharing options...
0 bogdaNNNNN Posted February 15, 2018 Author Report Share Posted February 15, 2018 Sa teleporteze id-ul respectiv la dmv Quote Link to comment Share on other sites More sharing options...
0 Banditul Posted February 15, 2018 Report Share Posted February 15, 2018 Vrei ca in calitate de admin/helper la tastarea comenzi sa teleportezi x player la acele coordonate? Sau vrei ca toata lumea sa aibe acces la comanda? Pentru primul caz foloseste sscanf: CMD:dmv(playerid, params[]){ if(PlayerInfo[playerid][pAdmin] < 1 || PlayerInfo[playerid][pHelper] < 3) return SendClientMessage(playerid, COLOR_WHITE,AdminOnly); new string[250]; new id; if(sscanf(params, "u")) return SendClientMessage(playerid, -1, "USAGE: /dmv <id>"); if(IsPlayerInAnyVehicle(id)) SetVehiclePos(GetPlayerVehicleID(id),1218.9750,-1812.7285,16.5938); if(GetPlayerState(id) == PLAYER_STATE_ONFOOT) SetPlayerPos(id, 1218.9750,-1812.7285,16.5938); SetPlayerInterior(id,0); return 1; } In felul asta. Ce ai facut tu nu avea logica. Pentru a folosi numele/id-ul unui jucator intr-o comanda(mai exact sa ii faci ceva acelui jucator) folosesti sscanf cu acel u (u = playerid/playername) care va indentifica automat jucaotrul Pentru al doilea caz doar sterge acel if de la inceput cu pAdmin si pHelper Quote Link to comment Share on other sites More sharing options...
0 bogdaNNNNN Posted February 15, 2018 Author Report Share Posted February 15, 2018 Multumesc mult <3 Quote Link to comment Share on other sites More sharing options...
0 Razvan Eternity Posted February 15, 2018 Report Share Posted February 15, 2018 3 minutes ago, bogdaNNNNN said: Multumesc mult <3 A uitat sa verifice daca ID-ul este conectat, uite aici comanda: CMD:dmv(playerid, params[]){ if(PlayerInfo[playerid][pAdmin] < 1 || PlayerInfo[playerid][pHelper] < 3) return SendClientMessage(playerid, COLOR_WHITE,AdminOnly); new string[250]; new id; if(sscanf(params, "u")) return SendClientMessage(playerid, -1, "USAGE: /dmv <id>"); if(!IsPlayerConnected(id) && gPlayerLogged[id] == 1) return SCM(playerid, -1, "ERROR: Player not connected"); if(IsPlayerInAnyVehicle(id)) SetVehiclePos(GetPlayerVehicleID(id),1218.9750,-1812.7285,16.5938); if(GetPlayerState(id) == PLAYER_STATE_ONFOOT) SetPlayerPos(id, 1218.9750,-1812.7285,16.5938); SetPlayerInterior(id,0); return 1; } Quote Link to comment Share on other sites More sharing options...
0 bogdaNNNNN Posted February 15, 2018 Author Report Share Posted February 15, 2018 Am incercat comanda, tot pe mine ma teleporteaza.. Quote Link to comment Share on other sites More sharing options...
0 valivaly96 Posted February 15, 2018 Report Share Posted February 15, 2018 (edited) Acum 21 minute, bogdaNNNNN a spus: Am incercat comanda, tot pe mine ma teleporteaza.. CMD:dmv(playerid, params[]){ if(PlayerInfo[playerid][pAdmin] < 1 || PlayerInfo[playerid][pHelper] < 3) return SendClientMessage(playerid, COLOR_WHITE,AdminOnly); new string[250]; new id; if(sscanf(params, "u",id)) return SendClientMessage(playerid, -1, "USAGE: /dmv <id>"); if(!IsPlayerConnected(id) && gPlayerLogged[id] == 1) return SCM(playerid, -1, "ERROR: Player not connected"); if(IsPlayerInAnyVehicle(id)) SetVehiclePos(GetPlayerVehicleID(id),1218.9750,-1812.7285,16.5938); if(GetPlayerState(id) == PLAYER_STATE_ONFOOT) SetPlayerPos(id, 1218.9750,-1812.7285,16.5938); SetPlayerInterior(id,0); return 1; } if(sscanf(params, "u",id)) // lipsea id. Edited February 15, 2018 by valivaly96 Quote Link to comment Share on other sites More sharing options...
0 bogdaNNNNN Posted February 15, 2018 Author Report Share Posted February 15, 2018 A functionat, multumesc frumos. Se poate inchide topic-ul. Quote Link to comment Share on other sites More sharing options...
0 StrikerM Posted February 16, 2018 Report Share Posted February 16, 2018 Acum 13 ore, RazvaN. a spus: A uitat sa verifice daca ID-ul este conectat, uite aici comanda: CMD:dmv(playerid, params[]){ if(PlayerInfo[playerid][pAdmin] < 1 || PlayerInfo[playerid][pHelper] < 3) return SendClientMessage(playerid, COLOR_WHITE,AdminOnly); new string[250]; new id; if(sscanf(params, "u")) return SendClientMessage(playerid, -1, "USAGE: /dmv <id>"); if(!IsPlayerConnected(id) && gPlayerLogged[id] == 1) return SCM(playerid, -1, "ERROR: Player not connected"); if(IsPlayerInAnyVehicle(id)) SetVehiclePos(GetPlayerVehicleID(id),1218.9750,-1812.7285,16.5938); if(GetPlayerState(id) == PLAYER_STATE_ONFOOT) SetPlayerPos(id, 1218.9750,-1812.7285,16.5938); SetPlayerInterior(id,0); return 1; } Nu este nevoie sa verifici daca este sau nu conectat... pentru ca in primul si in primul rand persoana daca nu este conectata nu poate sa foloseasca comenzi sau sa se foloseasca pe el asta e o porcarie din scripturile de acum 100 de ani Quote Ce inseamna cuvantul "Unic" este atunci cand Chestia / Obiectul / Idea / etc... nu exista in alta parte. Copii, nu mai veniti cu vorbe de "Am gamemode unic", nu exista asa ceva, la ora actuala totul este pe net. Aveti grija pe cine ajutati, majoritatea sunt caini. Link to comment Share on other sites More sharing options...
0 Banditul Posted February 16, 2018 Report Share Posted February 16, 2018 Acum 6 minute, StR_Marian a spus: Nu este nevoie sa verifici daca este sau nu conectat... pentru ca in primul si in primul rand persoana daca nu este conectata nu poate sa foloseasca comenzi sau sa se foloseasca pe el asta e o porcarie din scripturile de acum 100 de ani Prostie e sa verifici daca playerid este conectat, dar sa verifici daca x id este conectat este o necesitate(nu in cazul de fata) pentru ca poti avea de a face cu PlayerInfo si daca pasezi INVALID_PLAYER_ID catre PlayerInfo estee posibil sa ai de a face cu Index out of bounds si posibil crash Quote Link to comment Share on other sites More sharing options...
0 Razvan Eternity Posted February 16, 2018 Report Share Posted February 16, 2018 2 hours ago, StR_Marian said: Nu este nevoie sa verifici daca este sau nu conectat... pentru ca in primul si in primul rand persoana daca nu este conectata nu poate sa foloseasca comenzi sau sa se foloseasca pe el asta e o porcarie din scripturile de acum 100 de ani Esti prea noob, poti sa te lasi. Daca nu faci aceea verificare, nu va avea pe cine sa teleporteze , Daca nu stii nici sa faci o comanda, e grav rau. Quote Link to comment Share on other sites More sharing options...
0 Razvan Eternity Posted February 16, 2018 Report Share Posted February 16, 2018 2 hours ago, Banditul said: Prostie e sa verifici daca playerid este conectat, dar sa verifici daca x id este conectat este o necesitate(nu in cazul de fata) pentru ca poti avea de a face cu PlayerInfo si daca pasezi INVALID_PLAYER_ID catre PlayerInfo estee posibil sa ai de a face cu Index out of bounds si posibil crash Este necesar de a face o verificare daca ID este conectat. Quote Link to comment Share on other sites More sharing options...
0 StrikerM Posted February 16, 2018 Report Share Posted February 16, 2018 Acum 41 minute, RazvaN. a spus: Este necesar de a face o verificare daca ID este conectat. ... tot ce face linia respectiva este sa vada daca jucatorul pe care il teleportezi la dmv este sau nu conectat... comanda poate functiona perfect doar ca daca nu ar exista id-ul respectiv nu primesti nici un mesaj cum ca "id-ul nu exista". Si este de ajuns sa lasi doar gPlayerLogged pentru ca o data ce este logat e clar ca este si conectat Quote Ce inseamna cuvantul "Unic" este atunci cand Chestia / Obiectul / Idea / etc... nu exista in alta parte. Copii, nu mai veniti cu vorbe de "Am gamemode unic", nu exista asa ceva, la ora actuala totul este pe net. Aveti grija pe cine ajutati, majoritatea sunt caini. Link to comment Share on other sites More sharing options...
0 Razvan Eternity Posted February 16, 2018 Report Share Posted February 16, 2018 2 hours ago, StR_Marian said: ... tot ce face linia respectiva este sa vada daca jucatorul pe care il teleportezi la dmv este sau nu conectat... comanda poate functiona perfect doar ca daca nu ar exista id-ul respectiv nu primesti nici un mesaj cum ca "id-ul nu exista". Si este de ajuns sa lasi doar gPlayerLogged pentru ca o data ce este logat e clar ca este si conectat Daca nu ai gPlayerLogged[playerid] = 0; la onplayerdisconnect nu e deconectat. Quote Link to comment Share on other sites More sharing options...
0 StrikerM Posted February 16, 2018 Report Share Posted February 16, 2018 Acum 10 minute, RazvaN. a spus: Daca nu ai gPlayerLogged[playerid] = 0; la onplayerdisconnect nu e deconectat. Si de ce nu ai avea =))))))))))))))))))))))))))))))))))))) OMG... Quote Ce inseamna cuvantul "Unic" este atunci cand Chestia / Obiectul / Idea / etc... nu exista in alta parte. Copii, nu mai veniti cu vorbe de "Am gamemode unic", nu exista asa ceva, la ora actuala totul este pe net. Aveti grija pe cine ajutati, majoritatea sunt caini. Link to comment Share on other sites More sharing options...
Question
bogdaNNNNN
Salut, am facut aceasta comanda, dar ma teleporteaza doar pe mine.. cum fac sa teleporteze si alti playeri la acele Coordonate?
Link to comment
Share on other sites
15 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.