17.11.2010, 20:41
pawn Code:
if(!strcmp(cmdtext, "/stars", true))
{
ShowPlayerDialog(playerid, JOINSTARS, DIALOG_STYLE_INPUT, "Please enter the password to join S.T.A.R.S.", "Password:", "Submit", "Cancel");
HideMenuForPlayer(mainmenu,playerid);
}
if(!strcmp(cmdtext, "/uc", true))
{
ShowPlayerDialog(playerid, JOINUC, DIALOG_STYLE_INPUT, "Please enter the password to join UC.", "Password:", "Submit", "Cancel");
HideMenuForPlayer(mainmenu,playerid);
}
return 1;
}
pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == JOINSTARS)
{
if(response)
{
if(!strcmp(inputtext, "starspass", true))
{
team[playerid] = 6;
ShowPlayerDialog(playerid, JOINSTARS, DIALOG_STYLE_INPUT, "Please enter the password to join S.T.A.R.S.", "Password:", "Submit", "Cancel");
SendClientMessage(playerid,GREEN,"You may now spawn.");
SetPlayerColor(playerid,GREEN);
SetPlayerTeam(playerid, 1);
SetPlayerPos(playerid,1624.2527,1821.0498,10.8203) ;
SetPlayerFacingAngle(playerid,5.6779);
GivePlayerWeapon(playerid,31,300);
GivePlayerWeapon(playerid,24,300);
GivePlayerMoney(playerid, 20000);
SetPlayerInterior(playerid,0);
SetPlayerArmour(playerid, 100);
}
}
else SendClientMessage(playerid, 0xff0000FF,"Cancelled");
}
if(dialogid == JOINUC)
{
if(response)
{
if(!strcmp(inputtext, "ucpass", true))
{
team[playerid] = 7;
ShowPlayerDialog(playerid, JOINUC, DIALOG_STYLE_INPUT, "Please enter the password to join UC.", "Password:", "Submit", "Cancel");
SendClientMessage(playerid,GREEN,"You may now spawn.");
SetPlayerColor(playerid,TAN);
SetPlayerTeam(playerid, 1);
SetPlayerFacingAngle(playerid,5.6779);
GivePlayerWeapon(playerid,31,300);
GivePlayerWeapon(playerid,24,300);
GivePlayerMoney(playerid, 20000);
SetPlayerInterior(playerid,0);
SetPlayerArmour(playerid, 100);
}
}
else SendClientMessage(playerid, 0xff0000FF,"Cancelled");
}
return 1;
}
but when the players use /stars or /uc and click submit (without entering the password) it put him on the team. What's wrong ?