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

Question

Posted (edited)

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

4 answers to this question

Recommended Posts

  • 0
Posted
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, "", "");
              }
           }
        } 

 

  • 0
Posted

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, "", "");
        }
    }
}

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
×
×
  • 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.