Jump to content
  • 0

Intrebare


Funnk@

Question

6 answers to this question

Recommended Posts

  • 0
CMD:gotojob(playerid, params[])
{
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
	if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, COLOR_LIGHTGREEN3, AdminOnly);
	new id;
	if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_GREY, "Scrie: /gotojob [job id]");
	if(id < 0 || id > 13) return SendClientMessage(playerid, COLOR_GREY, "Invalid job id");
	SetPlayerPos(playerid, JobInfo[id][jPosX], JobInfo[id][jPosY], JobInfo[id][jPosZ]);
	SetPlayerInterior(playerid, 0);
	SetPlayerVirtualWorld(playerid, 0);
	new string[180];
	format(string, sizeof(string), "%s used /gotojob %d (%s).", GetName(playerid), id, JobInfo[id][jName]);
	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
	return 1;
}

"SetPlayerPos(playerid, JobInfo[id][jPosX], JobInfo[id][jPosY], JobInfo[id][jPosZ]);"

Verifica daca se incarca bine coordonatele in array-ul JobInfo.

Link to comment
Share on other sites

  • 0
1 hour ago, Lunoxx said:

CMD:gotojob(playerid, params[])
{
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
	if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, COLOR_LIGHTGREEN3, AdminOnly);
	new id;
	if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_GREY, "Scrie: /gotojob [job id]");
	if(id < 0 || id > 13) return SendClientMessage(playerid, COLOR_GREY, "Invalid job id");
	SetPlayerPos(playerid, JobInfo[id][jPosX], JobInfo[id][jPosY], JobInfo[id][jPosZ]);
	SetPlayerInterior(playerid, 0);
	SetPlayerVirtualWorld(playerid, 0);
	new string[180];
	format(string, sizeof(string), "%s used /gotojob %d (%s).", GetName(playerid), id, JobInfo[id][jName]);
	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
	return 1;
}

"SetPlayerPos(playerid, JobInfo[id][jPosX], JobInfo[id][jPosY], JobInfo[id][jPosZ]);"

Verifica daca se incarca bine coordonatele in array-ul JobInfo.

In gm nu am avut nicio chestie de gotojob, am luat comanda din alt gm, am editat-o, am rezolvat niste erori si warning-uri, dar coordonatele la jobs nu le-am pus, mai exact imi poti spune unde sa le pun? 

Si in legatura cu jobinfo, am doar atat https://pastebin.com/qeziEqkR

Link to comment
Share on other sites

  • 0
2 hours ago, Funnk@ said:

In gm nu am avut nicio chestie de gotojob, am luat comanda din alt gm, am editat-o, am rezolvat niste erori si warning-uri, dar coordonatele la jobs nu le-am pus, mai exact imi poti spune unde sa le pun? 

Si in legatura cu jobinfo, am doar atat https://pastebin.com/qeziEqkR

Pai si atunci cum te astepti sa mearga.. ? Te duce la coordonatele 0, nu in aer (adica te baga sub harta).

Se intampla asta pentru ca in array-ul ala nu inserezi nimic, tu ai luat comanda din ceva gamemode care avea informatii despre job-uri in baza de date. Ca sa faci comanda aia sa mearga trebuie sa modifici sistemul de joburi sau sa iti faci comanda pentru sistemul tau, sa pui manual coordonate pentru fiecare job.

Edited by Lunoxx
Link to comment
Share on other sites

  • 0
5 minutes ago, Lunoxx said:

Pai si atunci cum te astepti sa mearga.. ? Te duce la coordonatele 0, nu in aer (adica te baga sub harta).

Se intampla asta pentru ca tu in array-ul ala nu inserezi nimic, tu ai luat comanda din ceva gamemode care avea informatii despre job-uri in baza de date. Tu ca sa faci comanda aia sa mearga trebuie sa modifici sistemul de joburi sau sa iti faci comanda pentru sistemul tau, sa pui manual coordonate pentru fiecare job.

Am inteles, am adaugat la comanda asa 

https://pastebin.com/hfhuh0G7

E ok? In joc merge, nu-mi da erori sau cv.

Link to comment
Share on other sites

  • 0

Da, e ok.

Poftim o alta varianta, poate inveti ceva din ea:

new Float: jobsLocations[][] = {
	{100.0, 200.0, 300.0},	// locatia jobului 1
	{100.0, 200.0, 300.0},	// locatia jobului 2
	{100.0, 200.0, 300.0}, 	// locatia jobului 3
	{....................}, 	// locatia jobului X
	{x, y, z}				// locatia ultimului job (nu mai pui virgula la final)
};

CMD:gotojob(playerid, params[]) {
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
    if(PlayerInfo[playerid][pAdmin] == 0) return SCM(playerid, COLOR_LIGHTGREEN3, AdminOnly);
    new id;
    if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_GREY, "Scrie: /gotojob [job id]");
    if(id < 0 || id > 13) return SendClientMessage(playerid, COLOR_GREY, "Invalid job id");
    SetPlayerPos(jobsLocations[id][0], jobsLocations[id][1], jobsLocations[id][2]);
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 0);
    return 1;
}

 

Edited by Lunoxx
Link to comment
Share on other sites

  • 0
6 minutes ago, Lunoxx said:

Da, e ok.

Poftim o alta varianta, poate inveti ceva din ea:


new Float: jobsLocations[][] = {
	{100.0, 200.0, 300.0},	// locatia jobului 1
	{100.0, 200.0, 300.0},	// locatia jobului 2
	{100.0, 200.0, 300.0}, 	// locatia jobului 3
	{....................}, 	// locatia jobului X
	{x, y, z}				// locatia ultimului job (nu mai pui virgula la final)
};

CMD:gotojob(playerid, params[]) {
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
    if(PlayerInfo[playerid][pAdmin] == 0) return SCM(playerid, COLOR_LIGHTGREEN3, AdminOnly);
    new id;
    if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_GREY, "Scrie: /gotojob [job id]");
    if(id < 0 || id > 13) return SendClientMessage(playerid, COLOR_GREY, "Invalid job id");
    SetPlayerPos(jobsLocations[id][0], jobsLocations[id][1], jobsLocations[id][2]);
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 0);
    return 1;
}

 

Multumesc!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.