#1

I Want to Know How can i make So When a Civilan Player Spawns in cops and robbers he can choose a job
Reply
#2

pawn Код:
#define DIALOG_SKILLS 255 //Or another positive number
#define SKILL_0 0
#define SKILL_1 1
#define SKILL_2 2
#define SKILL_3 3

new playerSkill[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
    ShowPlayerDialog(playerid, DIALOG_SKILLS, DIALOG_STYLE_LIST, "Select a skill:" , "Skill 0\nSkill 1\nSkill 2\nSkill 3", "Select", "");
  return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  switch(dialogid)
  {
    case DIALOG_SKILLS:
    {
      if(!response) return 1;
      switch(listitem)
      {
        case 0: { playerSkill[playerid] = SKILL_0; SendClientMessage(playerid, 0x00FF00FF, "You selected skill '0'");
        case 1: { playerSkill[playerid] = SKILL_1; SendClientMessage(playerid, 0x00FF00FF, "You selected skill '1'");
        case 2: { playerSkill[playerid] = SKILL_2; SendClientMessage(playerid, 0x00FF00FF, "You selected skill '2'");
        case 3: { playerSkill[playerid] = SKILL_3; SendClientMessage(playerid, 0x00FF00FF, "You selected skill '3'");

      }

    }

  }
  return 0;
}
Reply
#3

Код:
 D:\Games\[S.W.T] Three City Stunt\gamemodes\Dm.pwn(1290) : error 014: invalid statement; not in switch
D:\Games\[S.W.T] Three City Stunt\gamemodes\Dm.pwn(1290) : warning 215: expression has no effect
D:\Games\[S.W.T] Three City Stunt\gamemodes\Dm.pwn(1290) : error 001: expected token: ";", but found ":"
D:\Games\[S.W.T] Three City Stunt\gamemodes\Dm.pwn(1290) : error 029: invalid expression, assumed zero
D:\Games\[S.W.T] Three City Stunt\gamemodes\Dm.pwn(1290) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#4

What's the error line?

EDIT: OK, I know the error, the 4 brackets after SendClientmessagesss
Reply
#5

1290

Quote:
Originally Posted by [GF]Sasino97
Посмотреть сообщение
What's the error line?
Reply
#6

New code:

pawn Код:
#define DIALOG_SKILLS 255 //Or another positive number
#define SKILL_0 0
#define SKILL_1 1
#define SKILL_2 2
#define SKILL_3 3

new playerSkill[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
    ShowPlayerDialog(playerid, DIALOG_SKILLS, DIALOG_STYLE_LIST, "Select a skill:" , "Skill 0\nSkill 1\nSkill 2\nSkill 3", "Select", "");
  return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  switch(dialogid)
  {
    case DIALOG_SKILLS:
    {
      if(!response) return 1;
      switch(listitem)
      {
        case 0: { playerSkill[playerid] = SKILL_0; SendClientMessage(playerid, 0x00FF00FF, "You selected skill '0'"); }//Forgot this ...
        case 1: { playerSkill[playerid] = SKILL_1; SendClientMessage(playerid, 0x00FF00FF, "You selected skill '1'"); }
        case 2: { playerSkill[playerid] = SKILL_2; SendClientMessage(playerid, 0x00FF00FF, "You selected skill '2'"); }
        case 3: { playerSkill[playerid] = SKILL_3; SendClientMessage(playerid, 0x00FF00FF, "You selected skill '3'"); }

      }

    }

  }
  return 0;
}
PS:
Quote:

This forum requires that you wait 120 seconds between posts. Please try again in 37 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 22 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 11 seconds.

LoL
Reply
#7

And how can i define Some skins as a civilian and how to define that only civilians can see this dialog?

Also how to add commands for each skill?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)