Jump to content
  • 0

Problema mesaj la anumit job


Sprite_RoPlayers

Question

Hai seara buna.

Am si eu urmatoare problema si nu stiu cum as putea sa o rezolv. Vreau ca atunci cand dai la un anumit job sa ii apara si comanda de care are nevoie pentru a folosi acel job ca sa inceapa 

Am facut asa eu

else if(j == 16) SCM(playerid, COLOR_LIGHTBLUE, "Pentru a incepe sa te antrenenzi, ai la dispozitie comanda /startantrenament.");

Si am incercat si asa

else if(j != 16) SCM(playerid, COLOR_LIGHTBLUE, "Pentru a incepe sa te antrenenzi, ai la dispozitie comanda /startantrenament.");

asta este tot ce am in gm 

 if(PlayerInfo[playerid][pJob] == 0){
    	       for(new j = 1; j < MAX_JOBS; j++) {
                if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti aceasta comanda dintr-un vehicul!");
		        if(PlayerToPoint(3.0, playerid, JobInfo[j][jPosX], JobInfo[j][jPosY], JobInfo[j][jPosZ]) && j != 20) {
			       if(PlayerInfo[playerid][pLevel] < JobInfo[j][jLevel]) {
				   format(string, sizeof(string), "Ai nevoie de level %d pentru a lua jobul %s.",  JobInfo[j][jLevel], JobInfo[j][jName]);
				   SCM(playerid, COLOR_WHITE, string);
				   return 1;
   	               }

	    		   format(string, sizeof(string), "*Felicitari! Noul tau job este acum %s.", JobInfo[j][jName]);
			       SCM(playerid, COLOR_LIGHTBLUE, string);

    		       if(j == 7) SCM(playerid, COLOR_LIGHTBLUE, "Comenzile disponibile pentru acest job sunt: /repair si /refill.");
			   	   else if(j == 8) SCM(playerid, COLOR_LIGHTBLUE, "Pentru a localiza un player, foloseste comanda /find.");	
			   	   else if(j == 11) SCM(playerid, COLOR_LIGHTBLUE, "Pentru a incepe sa muncesti ai la dispozitie comanda /fish.");
			   	   else if(j != 6) SCM(playerid, COLOR_LIGHTBLUE, "Pentru a incepe sa muncesti, ai la dispozitie comanda /work.");
			   	   else if(j == 16) SCM(playerid, COLOR_LIGHTBLUE, "Pentru a incepe sa te antrenenzi, ai la dispozitie comanda /startantrenament.");
			   	   //else if(j !- 16) SCM(playerid, COLOR_LIGHTGREEN,"Pentru a incepe sa te antrenenzi, ai la dispozitie comanda /startantrenament");

			       PlayerInfo[playerid][pJob] = j;
			
    			   new str [128];
			       mysql_format(SQL, str, 128, "UPDATE `users` SET `Job`='%d' WHERE `ID`='%d' LIMIT 1",PlayerInfo[playerid][pJob],PlayerInfo[playerid][pSQLID]);
        	       mysql_tquery(SQL, str, "", "");
              }
           }
        } 

Dar nu merge ce-ia ce am facut eu si nu stiu cum sa rezolv

Edited by Sprite_RoPlayers
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
1 oră în urmă, iSkull a spus:

Prezinta tot scriptul ce tine de ce ai postat mai sus

Pai asta este cod-ul pe care il am eu la KEY_YES adica asta este functia de iti ei job-ul

        if(PlayerInfo[playerid][pJob] == 0){
    	       for(new j = 1; j < MAX_JOBS; j++) {
                if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti aceasta comanda dintr-un vehicul!");
		        if(PlayerToPoint(3.0, playerid, JobInfo[j][jPosX], JobInfo[j][jPosY], JobInfo[j][jPosZ]) && j != 7) {
			       if(PlayerInfo[playerid][pLevel] < JobInfo[j][jLevel]) {
				   format(string, sizeof(string), "Ai nevoie de level %d pentru a lua jobul %s.",  JobInfo[j][jLevel], JobInfo[j][jName]);
				   SCM(playerid, COLOR_WHITE, string);
				   return 1;
   	               }

	    		   format(string, sizeof(string), "*Felicitari! Noul tau job este acum %s.", JobInfo[j][jName]);
			       SCM(playerid, COLOR_LIGHTBLUE, string);

    		       if(j == 7) SCM(playerid, COLOR_LIGHTBLUE, "Comenzile disponibile pentru acest job sunt: /repair si /refill.");
			   	   else if(j == 8) SCM(playerid, COLOR_LIGHTBLUE, "Pentru a localiza un player, foloseste comanda /find.");	
			   	   else if(j == 11) SCM(playerid, COLOR_LIGHTBLUE, "Pentru a incepe sa muncesti ai la dispozitie comanda /fish.");
			   	   else if(j != 6) SCM(playerid, COLOR_LIGHTBLUE, "Pentru a incepe sa muncesti, ai la dispozitie comanda /work.");
			   	   else if(j == 16) SCM(playerid, COLOR_LIGHTBLUE, "Pentru a incepe sa te antrenenzi, ai la dispozitie comanda /startantrenament.");
			   	   //else if(j !- 16) SCM(playerid, COLOR_LIGHTGREEN,"Pentru a incepe sa te antrenenzi, ai la dispozitie comanda /startantrenament");

			       PlayerInfo[playerid][pJob] = j;
			
    			   new str [128];
			       mysql_format(SQL, str, 128, "UPDATE `users` SET `Job`='%d' WHERE `ID`='%d' LIMIT 1",PlayerInfo[playerid][pJob],PlayerInfo[playerid][pSQLID]);
        	       mysql_tquery(SQL, str, "", "");
              }
           }
        } 

 

Link to comment
Share on other sites

  • 0

incearca ceva de genu

	if(PlayerInfo[playerid][pJob] == 0) {
    for(new j = 1; j < MAX_JOBS; j++) {
        if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti aceasta comanda dintr-un vehicul!");
        if(PlayerToPoint(3.0, playerid, JobInfo[j][jPosX], JobInfo[j][jPosY], JobInfo[j][jPosZ]) && j != 20) {
            if(PlayerInfo[playerid][pLevel] < JobInfo[j][jLevel]) {
                format(string, sizeof(string), "Ai nevoie de level %d pentru a lua jobul %s.",  JobInfo[j][jLevel], JobInfo[j][jName]);
                SCM(playerid, COLOR_WHITE, string);
                return 1;
            }
            format(string, sizeof(string), "*Felicitari! Noul tau job este acum %s.", JobInfo[j][jName]);
            SCM(playerid, COLOR_LIGHTBLUE, string);
            PlayerInfo[playerid][pJob] = j;
	            switch(PlayerInfo[playerid][pJob]) {
                case 0: return true;
                case 1: SCM(playerid, COLOR_LIGHTBLUE, "Pentru a incepe sa muncesti, ai la dispozitie comanda /work.");
                case 2: SCM(playerid, COLOR_LIGHTBLUE, "Pentru a incepe sa muncesti, ai la dispozitie comanda /work2.");
            }
            new str [128];
            mysql_format(SQL, str, 128, "UPDATE `users` SET `Job`='%d' WHERE `ID`='%d' LIMIT 1",PlayerInfo[playerid][pJob],PlayerInfo[playerid][pSQLID]);
            mysql_tquery(SQL, str, "", "");
        }
    }
}

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.