help my with command
#1

hey all, i need a create command for jobs

my code:
Код:
COMMAND:job( playerid, params[ ] )
{
	new CharKintamasis;
	switch( CharKintamasis )
	{
		case 0: CharKintamasis = "Bedarbis";
		case 1: CharKintamasis = "Mechanikas";
		case 2: CharKintamasis = "Policijos Pareigūnas";
	}
	// my cmds...
	format( mystring, 100, "You job is: %s", CharKintamasis );
	SendClientMessage....
	return 1;
}
And i need to the print this: You job is: Mechanikas

what do it ?

sry for my bad english (
Reply
#2

Do you save the player's job in a variable or something?
Reply
#3

Do you have PlayerInfo defined?
If you do, here:

Код:
#define JOB_LIST 5413

CMD:job(playerid, params[])
{
        ShowPlayerDialog(playerid, JOB_LIST, DIALOG_STYLE_LIST, "Job List", "Job #1\nJob #2\Job #3", "Select", "Nevermind");
        return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
        switch(dialogid)
        {
                case JOB_LIST:
                {
                        switch(listitem)
                        {
                                case 0:
                                {
                                        SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}JOB: {FFFFFF}Your job is now Job #1");
                                        PlayerInfo[playerid][pJob] = 1; // assuming you have it defined
                                }
                                case 1:
                                {
                                        SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}JOB: {FFFFFF}Your job is now Job #2");
                                        PlayerInfo[playerid][pJob] = 2; // assuming you have it defined
                                }
                                case 2:
                                {
                                        SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}JOB: {FFFFFF}Your job is now Job #3");
                                        PlayerInfo[playerid][pJob] = 3; // assuming you have it defined
                                }
                        }
                }
        }
        return 1;
}
Reply
#4

no no no

i need create by this code:
Код:
COMMAND:job( playerid, params[ ] )
{
	new CharKintamasis;
	switch( CharKintamasis )
	{
		case 0: CharKintamasis = "Bedarbis";
		case 1: CharKintamasis = "Mechanikas";
		case 2: CharKintamasis = "Policijos Pareigūnas";
	}
	// my cmds...
	format( mystring, 100, "You job is: %s", CharKintamasis );
	SendClientMessage....
	return 1;
}
what from the string get text

if i have pinfo[ playerid ] [ job ] = 0;
when i write command /job i see this :

You job is: Mechanikas or other job.
Reply
#5

Код:
COMMAND:job(playerid, params[])
{
	new CharKintamasis[34];
	switch(pinfo[playerid][job])
	{
		case 0: CharKintamasis = "Bedarbis";
		case 1: CharKintamasis = "Mechanikas";
		case 2: CharKintamasis = "Policijos Pareigūnas";
	}
	// my cmds...
	format(CharKintamasis, sizeof (CharKintamasis), "You job is: %s", CharKintamasis);
	SendClientMessage....
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)