Код:
COMMAND:openaccount(playerid, cmdtext[], params[])
{
new pin;
if(!sscanf(params, "s", pin))
{
/* if(!IsNumeric(pin)){
SendClientMessage(playerid, COLOR_LIGHTRED, "Numbers only!");
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "HINT: /openaccount [PIN]");
return 1;
}
*/
if(PlayerInfo[playerid][CreatedAcc] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You have already opened a account!");
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "HINT: You can close your account anytime, but you'll have to pay credit first.");
return 1;
}
if(pin < 3 || pin > 8)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "It must be atleast 4 to 8 numbers!");
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "HINT: /openaccount [PIN]");
return 1;
}
PlayerInfo[playerid][pBankPin] = pin;
PlayerInfo[playerid][CreatedAcc] = 1;
SendClientMessage(playerid, COLOR_LIGHTRED, "Account succesfully created! You may manage it now.");
return 1;
}else{ SendClientMessage(playerid, COLOR_LIGHTRED, "/openaccount [PIN].");}
return 1;
}