Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch( dialogid )
{
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if (response)
{
if(!strlen(inputtext)) {
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""WHITE"Registering...",""RED"You have entered an invalid password.\n"WHITE"Type your password below to register a new account.","Register","Quit");
}
if(INI_Open(getINI(playerid))) {
INI_WriteString("Password",inputtext);
INI_WriteInt("Score",1);
INI_WriteInt("Cash",5000);
INI_WriteInt("Admin",0);
INI_Save();
INI_Close();
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""WHITE"Login",""WHITE"Type your password below to login.","Login","Quit");
}
}
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(!strlen(inputtext)) {
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an invalid password.\n"WHITE"Type your password below to login.","Login","Quit");
}
if(INI_Open(getINI(playerid))) {
INI_ReadString(PlayerInfo[playerid][pPass],"Password",20);
if(strcmp(inputtext,PlayerInfo[playerid][pPass],false)) {
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an incorrect password.\n"WHITE"Type your password below to login.","Login","Quit");
}
SetPlayerScore( playerid, INI_ReadInt("Score" ) );
ResetPlayerMoney( playerid );
GivePlayerMoney( playerid, INI_ReadInt( "Cash" ) );
PlayerInfo[playerid][pAdmin] = INI_ReadInt("Admin");
INI_Close();
}
}
}
case DIALOG_ID_NEON:
{
if(response)
{
switch(listitem)
{
case 0:
{
SetPVarInt(playerid, "Status", 1);
SetPVarInt(playerid, "neon", CreateObject(18648,0,0,0,0,0,0));
SetPVarInt(playerid, "neon1", CreateObject(18648,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "neon"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
SetPlayerTime(playerid,0,0);
}
case 1:
{
SetPVarInt(playerid, "Status", 1);
SetPVarInt(playerid, "neon2", CreateObject(18647,0,0,0,0,0,0));
SetPVarInt(playerid, "neon3", CreateObject(18647,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "neon2"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon3"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
SetPlayerTime(playerid,0,0);
}
case 2:
{
SetPVarInt(playerid, "Status", 1);
SetPVarInt(playerid, "neon4", CreateObject(18649,0,0,0,0,0,0));
SetPVarInt(playerid, "neon5", CreateObject(18649,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "neon4"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon5"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
SetPlayerTime(playerid,0,0);
}
case 3:
{
SetPVarInt(playerid, "Status", 1);
SetPVarInt(playerid, "neon6", CreateObject(18652,0,0,0,0,0,0));
SetPVarInt(playerid, "neon7", CreateObject(18652,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "neon6"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon7"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
SetPlayerTime(playerid,0,0);
}
case 4:
{
SetPVarInt(playerid, "Status", 1);
SetPVarInt(playerid, "neon8", CreateObject(18651,0,0,0,0,0,0));
SetPVarInt(playerid, "neon9", CreateObject(18651,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "neon8"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon9"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
SetPlayerTime(playerid,0,0);
}
case 5:
{
SetPVarInt(playerid, "Status", 1);
SetPVarInt(playerid, "neon10", CreateObject(18650,0,0,0,0,0,0));
SetPVarInt(playerid, "neon11", CreateObject(18650,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "neon10"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon11"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
SetPlayerTime(playerid,0,0);
}
case 6:
{
DestroyObject(GetPVarInt(playerid, "neon")); DeletePVar(playerid, "Status"); DestroyObject(GetPVarInt(playerid, "neon1")); DeletePVar(playerid, "Status"); DestroyObject(GetPVarInt(playerid, "neon2")); DeletePVar(playerid, "Status"); DestroyObject(GetPVarInt(playerid, "neon3"));
DeletePVar(playerid, "Status"); DestroyObject(GetPVarInt(playerid, "neon4")); DeletePVar(playerid, "Status"); DestroyObject(GetPVarInt(playerid, "neon5")); DeletePVar(playerid, "Status"); DestroyObject(GetPVarInt(playerid, "neon6")); DeletePVar(playerid, "Status"); DestroyObject(GetPVarInt(playerid, "neon7"));
DeletePVar(playerid, "Status"); DestroyObject(GetPVarInt(playerid, "neon8")); DeletePVar(playerid, "Status"); DestroyObject(GetPVarInt(playerid, "neon9")); DeletePVar(playerid, "Status"); DestroyObject(GetPVarInt(playerid, "neon10")); DeletePVar(playerid, "Status"); DestroyObject(GetPVarInt(playerid, "neon11"));
DeletePVar(playerid, "Status"); DestroyObject(GetPVarInt(playerid, "neon12")); DeletePVar(playerid, "Status"); DestroyObject(GetPVarInt(playerid, "neon13")); DeletePVar(playerid, "Status"); DestroyObject(GetPVarInt(playerid, "neon14")); DeletePVar(playerid, "Status"); DestroyObject(GetPVarInt(playerid, "neon15")); DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "neon16")); DeletePVar(playerid, "Status"); DestroyObject(GetPVarInt(playerid, "neon17")); DeletePVar(playerid, "Status"); SetPlayerTime(playerid,12,0);
}
}
}
}
case DIALOG_GUN:
{
if(response)
{
switch(listitem)
{
case 0:
{
GPW(playerid,4,ammo);
SCM(playerid,COLOR_YELLOW,"Have Fun With knife");
}
case 1:
{
GPW(playerid, 22, ammo);
SCM(playerid, COLOR_YELLOW, "Have Fun With 9mm!!");
}
case 2:
{
GPW(playerid, 23, ammo);
SCM(playerid, COLOR_YELLOW, "Have Fun With s9mm!!");
}
case 3:
{
GPW(playerid, 24, ammo);
SCM(playerid, COLOR_YELLOW, "Have Fun With Desert Eagle!!");
}
case 4:
{
GPW(playerid, 25, ammo);
SCM(playerid, COLOR_YELLOW, "Have Fun With Shotgun!!");
}
case 5:
{
GPW(playerid, 26, ammo);
SCM(playerid,COLOR_YELLOW,"Have Fun With Sawoff Shotgun!!");
}
case 6:
{
GPW(playerid, 27, ammo);
SCM(playerid,COLOR_YELLOW,"Have Fun With Combat ShotGun!!");
}
case 7:
{
GPW(playerid, 28,ammo);
SCM(playerid,COLOR_YELLOW,"Have Fun With Uzi!!");
}
case 8:
{
GPW(playerid,29,ammo);
SCM(playerid,COLOR_YELLOW,"Have Fun With MP5!!");
}
case 9:
{
GPW(playerid,30,ammo);
SCM(playerid,COLOR_YELLOW,"Have Fun With AK-47");
}
case 10:
{
GPW(playerid,31,ammo);
SCM(playerid,COLOR_YELLOW,"Have Fun With M4");
}
case 11:
{
GPW(playerid,32,ammo);
SCM(playerid,COLOR_YELLOW,"Have Fun With Tec-9");
}
case 12:
{
GPW(playerid,33,ammo);
SCM(playerid,COLOR_YELLOW,"Have Fun With Country Rifle");
}
case 13:
{
GPW(playerid,34,ammo);
SCM(playerid,COLOR_YELLOW,"Have Fun With Sniper Rifle");
}
case 14:
{
GPW(playerid,45,ammo);
SCM(playerid,COLOR_YELLOW,"Have Fun With Camera");
}
case 15:
{
GPW(playerid,46,1);
SCM(playerid,COLOR_YELLOW,"Have Fun With Parachute");
}
}
}
}
case DIALOG_MUSIC:
{
if(response)
{
switch(listitem)
{
case 0:
{
PlayAudioStreamForPlayer(playerid,"http://mp3.zing.vn/download/song/Noi-Anh-Khong-Thuoc-Ve-365DaBand/knJntLmalSzJgnHTZDJyvHLn");
}
case 1:
{
PlayAudioStreamForPlayer(playerid,"http://data.chiasenhac.com/downloads/1084/0/1083514-60fff019/128/Forever%20Alone%20Touliver%20Remix_%20-%20JustaTee%20[MP3%20128kbps].mp3");
}
case 2
{
PlayAudioStreamForPlayer(playerid,"http://mp3.zing.vn/download/song/Vut-Bay-Young-Generation-Thanh-Bui-Noo-Phuoc-Thinh-Dong-Nhi-Ong-Cao-Thang-Si-Thanh-Thanh-Tam-Tam-Tit-365DaBand-JustaTee-Kimmese-Mr-T/ZmJnTkmNlpdGzZhykFxybmkH");
}
case 3:
{
StopAudioStreamForPlayer(playerid);
}
}
}
}
}
return 1;
}