19.05.2011, 16:10
I Want to Know How can i make So When a Civilan Player Spawns in cops and robbers he can choose a job
#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;
}
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.
#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;
}
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. |