20.06.2014, 22:18
Hello guys I am scripting a RP gamemode from scratch to learn PAWN deeper and more effectively, I went through lots of things and solved them myself/with help of guys in here. But I am stuck in Bank PIN system, here is its' codes:
Whole system works fine, just when player types, for example "asd", it must say "You must put an integer value" but it says "Your password is succesfully set to 0" and you can log-in to your bank acc even by typing "agkjsahgjaksh" because such password also matches to 0. Any help is appreciated, thanks !
pawn Код:
if(dialogid == 46)
{
if(response)
{
new string[256];
if(!strval(inputtext))
{
SendClientMessage(playerid,-1,"{FF0000}[HATA]: {FFFFFF}Lьtfen numara giriniz.");
ShowPlayerDialog(playerid,46,DIALOG_STYLE_INPUT,"{FFAAEE}[T-RPG] - {FF0000}Banka Sistemi","Gцrьnьşe gцre ilk kez bankamıza geldiniz, lьtfen bir PIN kaydediniz.","Tamam","İptal");
}
if(strval(inputtext) == 0)
{
SendClientMessage(playerid,-1,"{FF0000}[HATA]: {FFFFFF}Yanlış bir değer girdiniz.");
SendClientMessage(playerid,-1,"{FF0000}(( {00FF00}[BİLGİLENDİRME]: {FFFFFF}Şifre harfden oluşamaz. Lьtfen RAKAM giriniz. {FF0000}))");
}
if(strlen(inputtext) >= 5 || strlen(inputtext) == 0)
{
SendClientMessage(playerid,-1,"{FF0000}[HATA]: {FFFFFF}Şifreniz en az 1, en зok 4 numara olabilir.");
ShowPlayerDialog(playerid,46,DIALOG_STYLE_INPUT,"{FFAAEE}[T-RPG] - {FF0000}Banka Sistemi","Gцrьnьşe gцre ilk kez bankamıza geldiniz, lьtfen bir PIN kaydediniz.","Tamam","İptal");
}
else
{
new sifre = strval(inputtext);
PlayerInfo[playerid][pBanka] = 1;
PlayerInfo[playerid][pPIN] = sifre;
format(string,sizeof(string),"{00FF00}[BİLGİLENDİRME]: {FFFFFF}Şifreniz başarıyla %i yapılmıştır.",sifre);
SendClientMessage(playerid,-1,string);
ShowPlayerDialog(playerid,45,DIALOG_STYLE_INPUT,"{FFAAEE}[T-RPG] - {FF0000}Banka Sistemi","Lьtfen alttaki kutucuğa kaydettiğiniz banka şifresini giriniz.","Tamam","İptal");
}
}
}
