11.01.2014, 10:42
I have a problem for my Toys System.
when i select toys on the toy list.
It go to quizwrong and AutoKick.
This the code.
when i select toys on the toy list.
It go to quizwrong and AutoKick.
This the code.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new string[256], line1[256];
if(strfind(inputtext, "%s", true) != -1)
{
format(string, sizeof(string), "AdmCmd: %s was kicked by system, Reason: Dialog Exploiting", GetName(playerid));
SendClientMessageToAll(COLOR_LIGHTRED, string);
Kick(playerid);
return 1;
}
switch( dialogid )
{
case DIALOG_TOYS1: // Toys
{
new info[16], type[16];
switch(listitem)
{
case 0: toyslot[playerid] = 0; case 1: toyslot[playerid] = 1; case 2: toyslot[playerid] = 2; case 3: toyslot[playerid] = 3; case 4: toyslot[playerid] = 4;
case 5: toyslot[playerid] = 5; case 6: toyslot[playerid] = 6; case 7: toyslot[playerid] = 7; case 8: toyslot[playerid] = 8; case 9: toyslot[playerid] = 9;
}
new index = toyslot[playerid];
if(PlayerInfo[playerid][pToyModel][index] == 0)
ShowPlayerDialog(playerid, DIALOG_TOYS2, DIALOG_STYLE_LIST, type, string, "Choose", "Back");
return 1;
}
case DIALOG_TOYS2: // Toy Add/Remove/Edit
{
if(response)
{
switch(listitem)
{
case 0:
{
if(!IsPlayerAttachedObjectSlotUsed(playerid, toyslot[playerid]))
{
ShowPlayerDialog(playerid, DIALOG_TOYS3, DIALOG_STYLE_LIST, "Choose a bone", "Spine\nHead\nLeft upper arm\nRight upper arm\nLeft hand\nRight hand\nLeft thigh\nRight thigh\nLeft foot\nRight foot\nRight calf\nLeft calf\nLeft forearmRight forearm\nLeft clavicle\nRight clavicle\nNeck\nJaw", "Choose", "Back");
}
else
{
RemovePlayerAttachedObject(playerid, toyslot[playerid]);
}
}
case 1:
{
EditAttachedObject(playerid, toyslot[playerid]);
}
}
}
new info[16], type[16];
if(!IsPlayerAttachedObjectSlotUsed(playerid, toyslot[playerid])) format(info, sizeof(info), "Show Toy");
else format(info, sizeof(info), "Hide Toy");
format(string, sizeof(string), "%s\nEdit Toy", info);
format(type, sizeof(type), "Toy Slot %d", toyslot[playerid]);
return 1;
}
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""COL_WHITE"Mendaftar...",""COL_RED"Anda memasukkan password yang salah.\n"COL_WHITE"Masukkan password untuk mendaftarkan akun anda.","Daftar","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Health", 100);
INI_Close(File);
ShowPlayerDialog(playerid, DIALOG_QUIZ, DIALOG_STYLE_LIST, "Quiz - Apa itu DeathMatch?", "Berduel dengan seseorang.\nAdu tinju dengan seseorang hingga tewas.\nMenembak seseorang tanpa alasan IC.", "Jawab", "Quit");
ForceClassSelection(playerid);
Connected[playerid] = 1;
SetPlayerCameraPos(playerid, 1545.2980, -1361.2811, 368.0274);
SetPlayerCameraLookAt(playerid, 1545.1799, -1362.2729, 367.2717);
InterpolateCameraLookAt(playerid, 1590.0299, -1689.4938, 47.3620, 1412.5718, -1690.9845, 41.9617, 5000, CAMERA_MOVE);
}
}
case DIALOG_QUIZ:
{
if (!response) return Kick(playerid);
if(response)
{
if(listitem != 2)
{
SendClientMessage(playerid, COLOR_NEWBIE, "Salah.");
ShowPlayerDialog(playerid, DIALOG_QUIZ3, DIALOG_STYLE_LIST, "Quiz - Apa itu PowerGaming?", "Memaksa RP kita pada orang lain, tanpa memberikan kesempatan bagi orang tersebut.\nMenggunakan kendaraan cepat untuk menghindari Polisi.\nMenerbangkan pesawat tanpa SIM.", "Jawab", "Quit");
quizwrong[playerid] += 1;
}
if(listitem == 2)
{
SendClientMessage(playerid, COLOR_NEWBIE, "Benar.");
ShowPlayerDialog(playerid, DIALOG_QUIZ2, DIALOG_STYLE_LIST, "Quiz - Apa itu MetaGaming?", "Mengendarai motor tanpa helm.\nMenggunakan Informasi OOC dalam IC.\nMelakukan tindak kriminal di keramaian.", "Jawab", "Quit");
InterpolateCameraPos(playerid, 1544.7931, -1362.1440, 366.9819, 1459.6842, -1661.7963, 57.8967, 5000, CAMERA_MOVE);
InterpolateCameraLookAt(playerid, 1412.5718, -1690.9845, 41.9617, 1531.1875, -1672.8884, 27.4342, 5000, CAMERA_MOVE);
}
}
return 1;
}
case DIALOG_QUIZ2:
{
if (!response) return Kick(playerid);
if(response)
{
if(listitem != 1)
{
SendClientMessage(playerid, COLOR_NEWBIE, "Salah.");
quizwrong[playerid] += 1;
ShowPlayerDialog(playerid, DIALOG_QUIZ5, DIALOG_STYLE_LIST, "Quiz - Apa yang anda lakukan jika menemui seorang Hacker?", "Memberitahu pada mereka untuk berhenti melakukannya.\nMelaporkannya secara diam-diam dan menjauhinya.\nMelaporkan pada Admin Server.", "Jawab", "Quit");
}
if(quizwrong[playerid] > 2)
{
SendClientMessage(playerid, -1, "Anda gagal dalam Quiz.");
Kick(playerid);
}
if(listitem == 1)
{
InterpolateCameraPos(playerid, 1459.6842, -1661.7963, 57.8967, 1474.3441, -1709.7754, 37.5671, 5000, CAMERA_MOVE);
InterpolateCameraLookAt(playerid, 1531.1875, -1672.8884, 27.4342, 1477.4785, -1726.4415, 30.8563, 5000, CAMERA_MOVE);
SendClientMessage(playerid, COLOR_NEWBIE, "Benar.");
ShowPlayerDialog(playerid, DIALOG_QUIZ3, DIALOG_STYLE_LIST, "Quiz - Apa itu PowerGaming?", "Memakai topi yang terbakar.\nMenggunakan kendaraan cepat untuk menghindari Polisi.\nMenerbangkan pesawat tanpa SIM.", "Jawab", "Quit");
}
}
return 1;
}
case DIALOG_QUIZ3:
{
if (!response) return Kick(playerid);
if(response)
{
if(listitem != 0)
{
SendClientMessage(playerid, COLOR_NEWBIE, "Salah.");
quizwrong[playerid] += 1;
ShowPlayerDialog(playerid, DIALOG_QUIZ5, DIALOG_STYLE_LIST, "Quiz - Bagaimana tahapan mengeluarkan senjata besar?", "/me mengeluarkan senjatanya\n* qmnty membuka bagasi dan mengambil Shotgunnya.\nHanya dikeluarkan.", "Jawab", "Quit");
}
if(quizwrong[playerid] > 2)
{
SendClientMessage(playerid, -1, "Anda gagal dalam Quiz.");
Kick(playerid);
}
if(listitem == 0)
{
InterpolateCameraPos(playerid, 1474.3441, -1709.7754, 37.5671, 2162.6824, -1756.9773, 45.1830, 5000, CAMERA_MOVE);
InterpolateCameraLookAt(playerid, 1477.4785, -1726.4415, 30.8563, 2220.4507, -1726.3226, 18.5690, 3000, CAMERA_MOVE);
SendClientMessage(playerid, COLOR_NEWBIE, "Benar.");
ShowPlayerDialog(playerid, DIALOG_QUIZ4, DIALOG_STYLE_LIST, "Quiz - Apa yang anda lakukan jika menemui seorang Hacker?", "Memberitahu pada mereka untuk berhenti melakukannya.\nMelaporkannya secara diam-diam dan menjauhinya.\nMelaporkan pada Admin Server.", "Jawab", "Quit");
}
}
return 1;
}
case DIALOG_QUIZ4:
{
if (!response) return Kick(playerid);
if(response)
{
if(listitem != 1)
{
SendClientMessage(playerid, COLOR_NEWBIE, "Salah.");
quizwrong[playerid] += 1;
ShowPlayerDialog(playerid, DIALOG_QUIZ6, DIALOG_STYLE_LIST, "Quiz - Apa itu RolePlay?", "Bermain sebagai Pembunuh Hebat.\nMenolong dalam /newb.\nBeraktifitas layaknya kehidupan nyata dengan menggunakan /me and /do.", "Jawab", "Quit");
}
if(quizwrong[playerid] > 2)
{
SendClientMessage(playerid, -1, "Anda gagal dalam Quiz.");
Kick(playerid);
}
if(listitem == 1)
{
SendClientMessage(playerid, COLOR_NEWBIE, "Benar.");
InterpolateCameraPos(playerid, 2162.6824, -1756.9773, 45.1830, 2265.1353, -2682.1121, 88.5434, 5000, CAMERA_MOVE);
InterpolateCameraLookAt(playerid, 2220.4507, -1726.3226, 18.5690, 2201.1077, -2638.2690, 16.4266, 3000, CAMERA_MOVE);
ShowPlayerDialog(playerid, DIALOG_QUIZ5, DIALOG_STYLE_LIST, "Quiz - Bagaimana tahapan mengeluarkan senjata besar?", "/me mengeluarkan senjatanya\n* qmnty membuka bagasi dan mengambil Shotgunnya.\nHanya dikeluarkan.", "Jawab", "Quit");
}
}
return 1;
}
case DIALOG_QUIZ5:
{
if (!response) return Kick(playerid);
if(response)
{
if(listitem != 1)
{
SendClientMessage(playerid, COLOR_NEWBIE, "Salah.");
quizwrong[playerid] += 1;
ShowPlayerDialog(playerid, DIALOG_QUIZ7, DIALOG_STYLE_LIST, "Quiz - Jika anda membutuhkan, apa yang anda lakukan?", "Bertanya lewat /newb tentang masalah anda.\nBertanya pada Admin tentang masalah anda.\nBertanya pada orang-orang lewat /b.", "Jawab", "Quit");
}
if(quizwrong[playerid] > 2)
{
SendClientMessage(playerid, -1, "Anda gagal dalam Quiz.");
Kick(playerid);
}
if(listitem == 1)
{
SendClientMessage(playerid, COLOR_NEWBIE, "Benar.");
InterpolateCameraPos(playerid, 2265.1353, -2682.1121, 88.5434, 1306.0331, -1283.6243, 52.5546, 5000, CAMERA_MOVE);
InterpolateCameraLookAt(playerid, 2201.1077, -2638.2690, 16.4266, 1360.0269, -1280.1663, 18.9822, 3000, CAMERA_MOVE);
ShowPlayerDialog(playerid, DIALOG_QUIZ6, DIALOG_STYLE_LIST, "Quiz - Apa itu RolePlay?", "Bermain sebagai Pembunuh Hebat.\nMenolong dalam /newb.\nBeraktifitas layaknya kehidupan nyata dengan menggunakan /me and /do.", "Jawab", "Quit");
}
}
return 1;
}
case DIALOG_QUIZ6:
{
if (!response) return Kick(playerid);
if(response)
{
if(listitem != 2)
{
SendClientMessage(playerid, COLOR_NEWBIE, "Salah.");
quizwrong[playerid] += 1;
ShowPlayerDialog(playerid, DIALOG_QUIZ8, DIALOG_STYLE_LIST, "Quiz - Apa itu IC dan OOC?", "In Car and Out Of Car.\nInjured Crackhead and Out Of Crack\nIn Character and Out Of Character", "Jawab", "Quit");
}
if(quizwrong[playerid] > 2)
{
SendClientMessage(playerid, -1, "Anda gagal dalam Quiz.");
Kick(playerid);
}
if(listitem == 2)
{
SendClientMessage(playerid, COLOR_NEWBIE, "Benar.");
InterpolateCameraPos(playerid, 1306.0331, -1283.6243, 52.5546, 1223.0563, -1304.5181, 59.4092, 5000, CAMERA_MOVE);
InterpolateCameraLookAt(playerid, 1360.0269, -1280.1663, 18.9822, 1177.9976, -1353.1117, 29.8385, 3000, CAMERA_MOVE);
ShowPlayerDialog(playerid, DIALOG_QUIZ7, DIALOG_STYLE_LIST, "Quiz - Jika anda membutuhkan, apa yang anda lakukan?", "Bertanya lewat /newb tentang masalah anda.\nBertanya pada Admin tentang masalah anda.\nBertanya pada orang-orang lewat /b.", "Jawab", "Quit");
}
}
return 1;
}
case DIALOG_QUIZ7:
{
if (!response) return Kick(playerid);
if(response)
{
if(listitem != 0)
{
SendClientMessage(playerid, COLOR_NEWBIE, "Salah.");
quizwrong[playerid] += 1;
if(quizwrong[playerid] > 2)
{
SendClientMessage(playerid, -1, "Anda gagal dalam Quiz.");
Kick(playerid);
}
ShowPlayerDialog(playerid, DIALOG_SKIN, DIALOG_STYLE_INPUT,""COL_WHITE"Pilih Skin",""COL_WHITE"Anda menyelesaikan test. Pilih Skin anda. Angka mulai dari 0 sampai 299.","Ganti","Tidak");
}
if(listitem == 0)
{
SendClientMessage(playerid, COLOR_NEWBIE, "Benar.");
InterpolateCameraPos(playerid, 1223.0563, -1304.5181, 59.4092, 1395.4175, -937.2007, 106.7558, 5000, CAMERA_MOVE);
InterpolateCameraLookAt(playerid, 1177.9976, -1353.1117, 29.8385, 1407.9408, -840.4412, 86.2264, 3000, CAMERA_MOVE);
ShowPlayerDialog(playerid, DIALOG_QUIZ8, DIALOG_STYLE_LIST, "Quiz - Apa itu IC dan OOC?", "In Car and Out Of Car.\nInjured Crackhead and Out Of Crack\nIn Character and Out Of Character", "Jawab", "Quit");
}
}
return 1;
}
case DIALOG_QUIZ8:
{
if (!response) return Kick(playerid);
if(response)
{
if(listitem != 2)
{
SendClientMessage(playerid, COLOR_NEWBIE, "Salah.");
quizwrong[playerid] += 1;
}
if(quizwrong[playerid] > 2)
{
SendClientMessage(playerid, -1, "Anda gagal dalam Quiz.");
Kick(playerid);
}
if(listitem == 2)
{
SendClientMessage(playerid, COLOR_NEWBIE, "Anda menyelesaikan test.");
InterpolateCameraPos(playerid, 1395.4175, -937.2007, 106.7558, 1543.3014, -1329.3446, 647.5134, 5000, CAMERA_MOVE);
InterpolateCameraLookAt(playerid, 1407.9408, -840.4412, 86.2264, 1543.0229, -1358.7617, 334.1657, 3000, CAMERA_MOVE);
ShowPlayerDialog(playerid, DIALOG_SKIN, DIALOG_STYLE_INPUT,""COL_WHITE"Pilih Skin",""COL_WHITE"Anda menyelesaikan test. Pilih skin anda. Angka mulai dari 0 sampai 299.","Ganti","Tidak");
}
}
return 1;
}