if(dialogid == godine)
{
if(response == 0)
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"{FF0000} GREЉKA","{FF0000}_______________________________\n\n Odustali ste od registracije pa\n\n ste izbaceni sa servera!\n\n_______________________________","Izadi","");
Kick(playerid); // kicks when player clicks cancel
return 1;
}
if(response == 1)
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,godine,DIALOG_STYLE_INPUT,"{FF0000} Godine","{FF0000}Unesite kolko godina ћelite da ima Vaљ lik:","U redu","Odustani");
SendClientMessage(playerid,CRVENA,"Godine ne smiju biti manje od 15 i vece od 100!");
// when nothing is entered the dialog shows again and sends a message
}
else
{
godinee(playerid,inputtext); // goes to stock which writes the years enterd in the player file
return 1;
}
}
if (!(15 <= inputtext <= 100))
{
//invalid year
}
else
{
//valid year
}
if (!(15 <= strval(inputtext) <= 100))
{
//invalid year
}
else
{
//valid year
}
if (inputtext[0] == '@')
{
//valid
}
else
{
//invalid
}
if (inputtext[0] == '@' && inputtext[0] == '.')
{
//valid
}
else
{
//invalid
}
if (!strcmp("@.",inputtext,true,2)) //the 2 is for 2 chars,
{
//valid
}
else
{
//invalid
}
pawn Код:
youll need to use strcmp |
if(dialogid==tut1)
{
if(response==0)
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"{FF0000} GREЉKA","{FF0000}_______________________________\n\n Odustali ste od registracije pa\n\n ste izbaceni sa servera!\n\n_______________________________","Izadi","");
new name[MAX_PLAYER_NAME],strPath[128];
GetPlayerName(playerid,name,sizeof(name));
format(strPath,sizeof(strPath), "/korisnici/%s.txt",name);
fremove(strPath);
Kick(playerid);///////// KICKS PLAYER AND DELETS THE FILE IF HE CLICKS CANCEL
return 1;
}
if(response==1)
{
if (!strcmp("@.",inputtext,true,2))// IF THE MAIL IS ENTERED WRONG WITHOUT @ and . WRITE IT AGAIN..
{
for(new i = 0; i < 50; i++) SendClientMessageToAll(BIJELA," ");
new string[128];
strcat(string, "{FF0000}\nMolimo unesite vaљu e-mail adresu:");
ShowPlayerDialog(playerid,tut1,DIALOG_STYLE_INPUT,"{FF0000} E-Mail",string,"U redu","Odustani");
SendClientMessage(playerid,CRVENA,"Morate unjeti valjanu E-mail adresu!");
}
else
{
mail(playerid,inputtext);//// WRITES HIS MAIL IN FILE AND GOES TO NEXT DIALOG
for(new i = 0; i < 50; i++) SendClientMessageToAll(BIJELA," ");
ShowPlayerDialog(playerid,tut2,DIALOG_STYLE_LIST,"{FF0000} Odaberite spol Vaљeg lika:","Musko\nZensko","U redu","Odustani");
SendClientMessage(playerid,CRVENA,"Odaberite spol vaљega lika!");
return 1;
}
}
}