Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×

Question

6 answers to this question

Recommended Posts

  • 0
Posted
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.

  • 0
Posted
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

  • 0
Posted (edited)
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
  • 0
Posted
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.

  • 0
Posted (edited)

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
  • 0
Posted
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!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.