SA-MP Forums Archive
Teams - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Teams (/showthread.php?tid=256194)



Teams - Sid_Alexander - 19.05.2011

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


Re: Teams - Sasino97 - 19.05.2011

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;
}



Re: Teams - Sid_Alexander - 19.05.2011

Код:
 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.



Re: Teams - Sasino97 - 19.05.2011

What's the error line?

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


Re: Teams - Sid_Alexander - 19.05.2011

1290

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



Re: Teams - Sasino97 - 19.05.2011

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


Re: Teams - Sid_Alexander - 19.05.2011

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?