ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What is your genre?", "Male\nFemale", "Select", "Quit");
You must rename yung dialog id to "s1" or any letter you want.
define it, #define s1 12328 then dialogid == s1 Setplayerskin(playerid, skinid); I almost did it but you must do it by yourself. |
#include <a_samp>
#include <classcontrol>
public OnPlayerEnterClassSelection(playerid)
{
//Now show your dialogs here:
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Select Genre", "your list", "Select", "");
return 0;//returning 0, the player will go to spectate screen
}
public OnPlayerExitClassSelection(playerid)
{
return 1;
}
public OnPlayerSwitchClass(playerid, classid, bool:next)
{
return 1;
}
public OnPlayerSpawnClass(playerid, classid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 0)
{
if(response)
{
switch(listitem)
{
case 0:
{
//your code, the player selected the 1st listitem
}//and so one...
}
}
}
return 1;
}
Gammix;3434041]Do you want to disable player class selection? |
I'm already disable player class selection.. i want to do if player enter the server..they are forced to select their genre.. after select the genre Male for example, they got random male skin and spawn at my setted coordinated.. can you make some script for me?
|
Yes, thats why i mentioned it. All those callbacks and functions are not default samp's functions.
|
public OnPlayerEnterClassSelection(playerid) { //Now show your dialogs here: ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Select Genre", "Just Give me random!", "OK", ""); return 0;//returning 0, the player will go to spectate screen }
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == 0) { if(response) { switch(listitem) { case 0: { SetPlayerSkin(playerid, 1);//The Truth Skin } } } } return 1; }
SpawnPlayer(playerid);
public OnPlayerRequestClass(playerid, classid)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What is your genre?", "Male\nFemale", "Select", "Quit");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==1)
{
if(!response) return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What is your genre?", "Male\nFemale", "Select", "Quit");
if(listitem==0)
{
new bool:Success;
while(!Success)
{
new skin=random(300);
if(skin<9 || (skin>13 && skin<39 && skin!=31) || (skin>41 && skin<53) || (skin>56 && skin<63) || (skin>65 & skin<75 && skin!=69) || (skin>77 && skin<87 && skin!=85)
|| (skin>93 && skin<129) || (skin>131 && skin<138) || (skin>141 && skin<150 && skin!=145 skin!=148) || (skin>152 && skin<190 && skin!=157 && skin!=169 && skin!=172 && skin!=178) || skin==200 || (skin>201 && skin<214 & skin!=205 && skin!=207 && skin!=211)
|| skin==217 || (skin>219 & skin<224) || (skin>226 && skin<231) || (skin>233 & skin<237) || (skin>238 && skin<243) || (skin>246 && skin<256 && skin!=251) || (skin>257 && skin!=263 && skin!=298)) Success=true;
if(Success)
{
SpawnPlayer(playerid);
SetPlayerSkin(playerid, skin);
}
}
}
if(listitem==1)
{
new bool:Success=true;
while(!Success)
{
new skin=random(300);
if(skin<9 || (skin>13 && skin<39 && skin!=31) || (skin>41 && skin<53) || (skin>56 && skin<63) || (skin>65 & skin<75 && skin!=69) || (skin>77 && skin<87 && skin!=85)
|| (skin>93 && skin<129) || (skin>131 && skin<138) || (skin>141 && skin<150 && skin!=145 skin!=148) || (skin>152 && skin<190 && skin!=157 && skin!=169 && skin!=172 && skin!=178) || skin==200 || (skin>201 && skin<214 & skin!=205 && skin!=207 && skin!=211)
|| skin==217 || (skin>219 & skin<224) || (skin>226 && skin<231) || (skin>233 & skin<237) || (skin>238 && skin<243) || (skin>246 && skin<256 && skin!=251) || (skin>257 && skin!=263 && skin!=298)) Success=false;
if(Success)
{
SpawnPlayer(playerid);
SetPlayerSkin(playerid, skin);
}
}
}
}
return 1;
}
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(400) : error 001: expected token: "-identifier-", but found "-integer value-" D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(401) : warning 212: possibly unintended bitwise operation D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402) : error 001: expected token: ")", but found "-integer value-" D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402) : error 029: invalid expression, assumed zero D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402) : warning 213: tag mismatch D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402 -- 403) : warning 212: possibly unintended bitwise operation D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402 -- 403) : warning 212: possibly unintended bitwise operation D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402 -- 403) : warning 215: expression has no effect D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(403) : error 001: expected token: ";", but found ")" D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(403) : fatal error 107: too many error messages on one line
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 0)
{
if(response)
{
switch(listitem)
{
case 0:
{
SetPlayerSkin(playerid, 1);//The Truth Skin
TogglePlayerSpectating(playerid, false);
return SpawnPlayer(playerid);
}
}
}
}
return 1;
}
pawn Код:
|
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(400) : error 001: expected token: "-identifier-", but found "-integer value-" D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(401) : warning 212: possibly unintended bitwise operation D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402) : error 001: expected token: ")", but found "-integer value-" D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402) : error 029: invalid expression, assumed zero D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402) : warning 213: tag mismatch D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402 -- 403) : warning 212: possibly unintended bitwise operation D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402 -- 403) : warning 212: possibly unintended bitwise operation D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402 -- 403) : warning 215: expression has no effect D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(403) : error 001: expected token: ";", but found ")" D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(403) : fatal error 107: too many error messages on one line