Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- //#define FILTERSCRIPT
- #include <a_samp>
- #include <dini>
- #include <dudb>
- stock IsValidSkin(skinid)
- {
- if (skinid < 0 || skinid > 299)
- return 0;
- switch (skinid)
- {
- case
- 3, 4, 5, 6, 8, 42, 65, 74,
- 86, 119, 149, 208, 273, 289: return 0;
- }
- return 1;
- }
- #define eadmin 0x33660000
- #define COLOR_ASKQ 0xFF0000FF
- #define CHECKPOINT_HOME 12
- #define COLOR_GRAD1 0xB4B5B7FF
- #define COLOR_GRAD2 0xBFC0C2FF
- #define COLOR_GRAD3 0xCBCCCEFF
- #define COLOR_GRAD4 0xD8D8D8FF
- #define COLOR_GRAD5 0xE3E3E3FF
- #define COLOR_GRAD6 0xF0F0F0FF
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_GREEN 0x9EC73DAA
- #define COLOR_GROVE 0x00FF00FF
- #define COLOR_RED 0xAA3333AA
- #define COLOR_COOLRED 0xB35959AA
- #define COLOR_ORANGE 0xFF9900AA
- #define COLOR_PINK 0xFF66FFAA
- #define COLOR_DARKRED 0x660000AA
- #define COLOR_BRIGHTRED 0xFF0000AA
- #define COLOR_INDIGO 0x4B00B0AA
- #define COLOR_VIOLET 0x9955DEEE
- #define COLOR_GRAYWHITE 0xEEEEFFC4
- #define COLOR_LIGHTNEUTRALBLUE 0xabcdef66
- #define COLOR_GREENISHGOLD 0xCCFFDD56
- #define COLOR_LIGHTBLUEGREEN 0x0FFDD349
- #define COLOR_NEUTRALBLUE 0xABCDEF01
- #define COLOR_LIGHTCYAN 0xAAFFCC33
- #define COLOR_LEMON 0xDDDD2357
- #define COLOR_LIGHTRED 0xFF6347AA
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_LIGHTGREEN 0x9ACD32AA
- #define COLOR_YELLOW 0xDABB3EAA
- #define COLOR_YELLOW2 0xF5DEB3AA
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_FADE1 0xE6E6E6E6
- #define COLOR_FADE2 0xC8C8C8C8
- #define COLOR_FADE3 0xAAAAAAAA
- #define COLOR_FADE4 0x8C8C8C8C
- #define COLOR_FADE5 0x6E6E6E6E
- #define COLOR_PURPLE 0xC2A2DAAA
- #define COLOR_CHAT1 0xF9B7FFAA
- #define COLOR_CHAT2 0xE6A9ECAA
- #define COLOR_CHAT3 0xC38EC7AA
- #define COLOR_CHAT4 0xD2B9D3AA
- #define COLOR_CHAT5 0xC6AEC7AA
- #define COLOR_ALLDEPT 0xFF8282AA
- #define COLOR_NEWS 0x458E1DAA
- #define COLOR_OOC 0xE0FFFFAA
- #define TEAM_CYAN 1
- #define TEAM_BLUE 2
- #define TEAM_GREEN 3
- #define TEAM_ORANGE 4
- #define TEAM_COR 5
- #define TEAM_BAR 6
- #define TEAM_TAT 7
- #define TEAM_CUN 8
- #define TEAM_STR 9
- #define TEAM_HIT 10
- #define TEAM_ADMIN 11
- #define OBJECTIVE_COLOR 0x64000064
- #define TEAM_GREEN_COLOR 0xFFFFFFAA
- #define TEAM_JOB_COLOR 0xFFB6C1AA
- #define TEAM_HIT_COLOR 0xFFFFFF00
- #define TEAM_BLUE_COLOR 0x8D8DFF00
- #define TEAM_RADIO_COLOR 0xF2D068FF
- #define COLOR_ADD 0x63FF60AA
- #define TEAM_GROVE_COLOR 0x00D900C8
- #define TEAM_VAGOS_COLOR 0xFFC801C8
- #define TEAM_BALLAS_COLOR 0xD900D3C8
- #define TEAM_AZTECAS_COLOR 0x01FCFFC8
- #define TEAM_CYAN_COLOR 0xFF8282AA
- #define TEAM_ORANGE_COLOR 0xFF830000
- #define TEAM_COR_COLOR 0x39393900
- #define TEAM_BAR_COLOR 0x00D90000
- #define TEAM_TAT_COLOR 0xBDCB9200
- #define TEAM_CUN_COLOR 0xD900D300
- #define TEAM_STR_COLOR 0x01FCFF00
- #define TEAM_ADMIN_COLOR 0x00808000
- #define COLOR_SEA 0x00808000
- #define COLOR_INVIS 0xAFAFAF00
- #define COLOR_SPEC 0xBFC0C200
- new file[256];
- new Float:positionx;
- new Float:positiony;
- new Float:positionz;
- forward Testing(playerid);
- ReturnUser(text[], playerid = INVALID_PLAYER_ID)
- {
- new pos = 0;
- while (text[pos] < 0x21) // Strip out leading spaces
- {
- if (text[pos] == 0) return INVALID_PLAYER_ID; // No passed text
- pos++;
- }
- new userid = INVALID_PLAYER_ID;
- if (IsNumeric(text[pos])) // Check whole passed string
- {
- // If they have a numeric name you have a problem (although names are checked on id failure)
- userid = strval(text[pos]);
- if (userid >=0 && userid < MAX_PLAYERS)
- {
- if(!IsPlayerConnected(userid))
- {
- /*if (playerid != INVALID_PLAYER_ID)
- {
- SendClientMessage(playerid, 0xFF0000AA, "User not connected");
- }*/
- userid = INVALID_PLAYER_ID;
- }
- else
- {
- return userid; // A player was found
- }
- }
- /*else
- {
- if (playerid != INVALID_PLAYER_ID)
- {
- SendClientMessage(playerid, 0xFF0000AA, "Invalid user ID");
- }
- userid = INVALID_PLAYER_ID;
- }
- return userid;*/
- // Removed for fallthrough code
- }
- // They entered [part of] a name or the id search failed (check names just incase)
- new len = strlen(text[pos]);
- new count = 0;
- new name[MAX_PLAYER_NAME];
- for (new i = 0; i < MAX_PLAYERS; i++)
- {
- if (IsPlayerConnected(i))
- {
- GetPlayerName(i, name, sizeof (name));
- if (strcmp(name, text[pos], true, len) == 0) // Check segment of name
- {
- if (len == strlen(name)) // Exact match
- {
- return i; // Return the exact player on an exact match
- // Otherwise if there are two players:
- // Me and MeYou any time you entered Me it would find both
- // And never be able to return just Me's id
- }
- else // Partial match
- {
- count++;
- userid = i;
- }
- }
- }
- }
- if (count != 1)
- {
- if (playerid != INVALID_PLAYER_ID)
- {
- if (count)
- {
- SendClientMessage(playerid, 0xFF0000AA, "Multiple users found, please narrow earch");
- }
- else
- {
- SendClientMessage(playerid, 0xFF0000AA, "No matching user found");
- }
- }
- userid = INVALID_PLAYER_ID;
- }
- return userid; // INVALID_USER_ID for bad return
- }
- IsNumeric(const string[])
- {
- for (new i = 0, j = strlen(string); i < j; i++)
- {
- if (string[i] > '9' || string[i] < '0') return 0;
- }
- return 1;
- }
- public Testing(playerid)
- {
- SetPlayerPos(playerid, -69.0184,565.1793,-1.0729);
- SetPlayerCameraPos(playerid, -175.2453,823.6674,59.7646);
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Welcome to Blank RP!", "This is an RP server. That being said, in order\n to play here, you must know how to RP.\n If you are new to RP, please select 'new'.\n If you already know how to RP, select 'not new'.", "New", "Not New");
- TogglePlayerControllable(playerid, 0);
- }
- new IsLogged[MAX_PLAYERS];
- new WrongTestAnswers[MAX_PLAYERS];
- enum pInfo
- {
- AdminLevel,
- Cash,
- Kills,
- Deaths,
- Faction,
- Family,
- Test,
- Gender,
- Skin,
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- #endif
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("Blank Script");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to Blank RP. If you have an exiting account, /login. Otherwise, /register.");
- IsLogged[playerid] = 0;
- return 1;
- }
- SavePos(playerid)
- {
- dini_IntSet(file, "PositionX", floatround(positionx));
- dini_IntSet(file, "PositionY", floatround(positiony));
- dini_IntSet(file, "PositionZ", floatround(positionz));
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- IsLogged[playerid] = 0;
- new Float:x;
- new Float:y;
- new Float:z;
- GetPlayerPos(playerid,x,y,z);
- positionx = x;
- positiony = y;
- positionz = z;
- SavePos(playerid);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(IsLogged[playerid] != 1) { return SendClientMessage(playerid, 0xFFFFFFFF, "You have not logged in yet, so you may not spawn!"); }
- {
- if(PlayerInfo[playerid][Test] == 1)
- {
- Testing(playerid);
- }
- else if(PlayerInfo[playerid][Test] != 1)
- {
- SetPlayerPos(playerid,positionx,positiony,positionz);
- }
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[256], idx, file[128], tmp[256], tmp2[256];
- cmd = strtok(cmdtext, idx);
- if(strcmp(cmd, "/makeadmin", true) == 0)
- {
- new string[128];
- new tmp[256];
- new player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
- new giveplayerid;
- if(PlayerInfo[playerid][AdminLevel] > 1336)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD1, "/makeadmin [playerid] [admin level]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- tmp = strtok(cmdtext, idx);
- new level = strval(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, player, sizeof(player));
- PlayerInfo[giveplayerid][AdminLevel] = level;
- printf("Admin %s made %s a level %d admin.", player, giveplayer, level);
- format(string, sizeof(string), "You are now an administrator level %d thanks to %s.", level, player);
- SendClientMessage(giveplayerid, 0x00C2ECFF, string);
- format(string, sizeof(string), "You have given %s level %d admin.", giveplayer,PlayerInfo[giveplayerid][AdminLevel]);
- SendClientMessage(playerid, 0x00C2ECFF, string);
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%i is not an active player.", giveplayerid);
- SendClientMessage(playerid, 0xE60000FF, string);
- }
- }
- else
- {
- SendClientMessage(playerid, 0xE60000FF, "You are not a lead admin!");
- }
- return 1;
- }
- if(strcmp(cmd, "/register", true) == 0)
- {
- new name[MAX_PLAYER_NAME];
- tmp = strtok(cmdtext, idx);
- GetPlayerName(playerid, name, sizeof(name));
- if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /register [password]");
- format(file,sizeof(file),"%s.ini",name);
- if(!fexist(file))
- {
- dini_Create(file);
- dini_IntSet(file, "Password", udb_hash(tmp));
- dini_IntSet(file,"AdminLevel", 0);
- dini_IntSet(file,"Cash", 0);
- dini_IntSet(file,"Faction", 0);
- dini_IntSet(file,"Family", 0);
- dini_IntSet(file,"Kills", 0);
- dini_IntSet(file,"Deaths", 0);
- dini_IntSet(file,"Test", 1);
- dini_IntSet(file,"Skin", 0);
- dini_IntSet(file, "PositionX", floatround(positionx));
- dini_IntSet(file, "PositionY", floatround(positiony));
- dini_IntSet(file, "PositionZ", floatround(positionz));
- SendClientMessage(playerid, eadmin, "[System]: Account Created!");
- PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
- GetPlayerName(playerid, name, sizeof(name));
- printf("%s has registered a account!", name);
- }
- else
- {
- SendClientMessage(playerid, COLOR_GRAD1, "An account with this username already exists! Please log in or pick a new name!");
- PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
- }
- return 1;
- }
- if(strcmp(cmd, "/login", true) == 0)
- {
- new PlayerName[24];
- tmp = strtok(cmdtext, idx);
- if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /login [password]");
- new name[MAX_PLAYER_NAME];
- if(IsLogged[playerid] == 1)
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You already are logged in!");
- return 1;
- }
- else
- {
- GetPlayerName(playerid, name, sizeof(name));
- format(file,sizeof(file),"%s.ini",name);
- if(fexist(file))
- {
- tmp2 = dini_Get(file, "Password");
- if(udb_hash(tmp) != strval(tmp2))
- {
- SendClientMessage(playerid, COLOR_GRAD1, "Incorrect password!");
- GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
- printf("%s has failed to login.", name);
- }
- else
- {
- IsLogged[playerid] = 1;
- SetPlayerMoney(playerid, dini_Int(file, "Cash"));
- PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
- PlayerInfo[playerid][Test] = dini_Int(file, "Test");
- SetPlayerSkin(playerid, dini_Int(file, "Skin"));
- SendClientMessage(playerid, COLOR_GRAD1, "Thank you for logging in. You may now spawn!");
- }
- }
- }
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 1)
- {
- if(response == 1)
- {
- ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "Tutorial", "You have selected you are a new player.\nYou will now be shown a short tutorial about RP.\nPay attention, it will help you greatly in succeeding on the server!", "Continue", "Cancel");
- }
- if(response == 0)
- {
- ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "1. What is RP?", "A. Taking on the role of a character.\nB. Killing everyone to get the highest score.\nC. None of the above.\nD. I don't know", "Select", "Cancel");
- }
- }
- if(dialogid == 2) // If the dialogid is 1 (our dialog) and they pressed 'Purchase'
- {
- if(response == 1)
- {
- switch(listitem)
- {
- case 0:
- {
- SendClientMessage(playerid, COLOR_GRAD1, "Correct, on to question number 2!");
- ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "2. What is DM?", "A. Dead Man, an exploit to run around while dead.\nB. Deed Making, making fake deeds.\nC. Death Matching, killing without proper IC reason.\nD. I don't know.", "Select", "Cancel");
- }
- case 1:
- {
- WrongTestAnswers[playerid] ++;
- SendClientMessage(playerid, COLOR_YELLOW, "Wrong answer! If you get one more answer wrong, you will be kicked and forced to restart.");
- ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "1. What is RP?", "A. Taking on the role of a character.\nB. Killing everyone to get the highest score.\nC. None of the above.\nD. I don't know", "Select", "Cancel");
- }
- case 2:
- {
- WrongTestAnswers[playerid] ++;
- SendClientMessage(playerid, COLOR_YELLOW, "Wrong answer! If you get one more answer wrong, you will be kicked and forced to restart.");
- ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "1. What is RP?", "A. Taking on the role of a character.\nB. Killing everyone to get the highest score.\nC. None of the above.\nD. I don't know", "Select", "Cancel");
- }
- case 3:
- {
- WrongTestAnswers[playerid] ++;
- SendClientMessage(playerid, COLOR_YELLOW, "Wrong answer! If you get one more answer wrong, you will be kicked and forced to restart.");
- ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "1. What is RP?", "A. Taking on the role of a character.\nB. Killing everyone to get the highest score.\nC. None of the above.\nD. I don't know", "Select", "Cancel");
- }
- }
- }
- else if(response == 0)
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You must complete the test in order to spawn. You have been kicked for cancelling.");
- Kick(playerid);
- }
- return 1;
- }
- if(dialogid == 4) // If the dialogid is 1 (our dialog) and they pressed 'Purchase'
- {
- if(response == 1)
- {
- switch(listitem)
- {
- case 0:
- {
- if(WrongTestAnswers[playerid] > 0)
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You answered two questions wrong, so you have been kicked.");
- Kick(playerid);
- }
- else if(WrongTestAnswers[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "Wrong answer! If you answer two questions wrong, you will be kicked!");
- WrongTestAnswers[playerid] ++;
- ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "2. What is DM?", "A. Dead Man, an exploit to run around while dead.\nB. Deed Making, making fake deeds.\nC. Death Matching, killing without proper IC reason.\nD. I don't know.", "Select", "Cancel");
- }
- }
- case 1:
- {
- if(WrongTestAnswers[playerid] > 0)
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You answered two questions wrong, so you have been kicked.");
- Kick(playerid);
- }
- else if(WrongTestAnswers[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "Wrong Answer! If you answer two questions wrong, you will be kicked!");
- WrongTestAnswers[playerid] ++;
- ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "2. What is DM?", "A. Dead Man, an exploit to run around while dead.\nB. Deed Making, making fake deeds.\nC. Death Matching, killing without proper IC reason.\nD. I don't know.", "Select", "Cancel");
- }
- }
- case 2:
- {
- SendClientMessage(playerid, COLOR_GRAD1, "Correct, on to question number 3!");
- ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "3. What is powergaming?", "A. Acting like you have a lot of power.\nB. Doing something impossible/forcing roleplay.\nC. Repeating certain actions over and over.\nD. I don't know.", "Select", "Cancel");
- }
- case 3:
- {
- if(WrongTestAnswers[playerid] > 0)
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You answered two questions wrong, so you have been kicked.");
- Kick(playerid);
- }
- else if(WrongTestAnswers[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "Wrong answer! If you answer two questions wrong, you will be kicked!");
- WrongTestAnswers[playerid] ++;
- ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "2. What is DM?", "A. Dead Man, an exploit to run around while dead.\nB. Deed Making, making fake deeds.\nC. Death Matching, killing without proper IC reason.\nD. I don't know.", "Select", "Cancel");
- }
- }
- }
- }
- else if(response == 0)
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You must complete the test in order to spawn. You have been kicked for cancelling.");
- Kick(playerid);
- }
- }
- if(dialogid == 5) // If the dialogid is 1 (our dialog) and they pressed 'Purchase'
- {
- if(response == 1)
- {
- switch(listitem)
- {
- case 0:
- {
- if(WrongTestAnswers[playerid] > 0)
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You answered two questions wrong, so you have been kicked.");
- Kick(playerid);
- }
- else if(WrongTestAnswers[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "Wrong answer! If you answer two questions wrong, you will be kicked!");
- WrongTestAnswers[playerid] ++;
- ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "3. What is powergaming?", "A. Acting like you have a lot of power.\nB. Doing something impossible/forcing roleplay.\nC. Repeating certain actions over and over.\nD. I don't know.", "Select", "Cancel");
- }
- }
- case 1:
- {
- SendClientMessage(playerid, COLOR_GRAD1, "Correct, on to question number 4!");
- ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "4. What is metagaming?", "A. Using OOC information IC.\nB. Alt Tabbing to avoid dying.\nC. Speaking in more than one language at a time.\nD. I don't know.", "Select", "Cancel");
- }
- case 2:
- {
- if(WrongTestAnswers[playerid] > 0)
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You answered two questions wrong, so you have been kicked.");
- Kick(playerid);
- }
- else if(WrongTestAnswers[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "Wrong answer! If you answer two questions wrong, you will be kicked!");
- WrongTestAnswers[playerid] ++;
- ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "3. What is powergaming?", "A. Acting like you have a lot of power.\nB. Doing something impossible/forcing roleplay.\nC. Repeating certain actions over and over.\nD. I don't know.", "Select", "Cancel");
- }
- }
- case 3:
- {
- if(WrongTestAnswers[playerid] > 0)
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You answered two questions wrong, so you have been kicked.");
- Kick(playerid);
- }
- else if(WrongTestAnswers[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "Wrong answer! If you answer two questions wrong, you will be kicked!");
- WrongTestAnswers[playerid] ++;
- ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "3. What is powergaming?", "A. Acting like you have a lot of power.\nB. Doing something impossible/forcing roleplay.\nC. Repeating certain actions over and over.\nD. I don't know.", "Select", "Cancel");
- }
- }
- }
- }
- else if(response == 0)
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You must complete the test in order to spawn. You have been kicked for cancelling.");
- Kick(playerid);
- }
- }
- if(dialogid == 6) // If the dialogid is 1 (our dialog) and they pressed 'Purchase'
- {
- if(response == 1)
- {
- switch(listitem)
- {
- case 0:
- {
- ShowPlayerDialog(playerid, 7, DIALOG_STYLE_MSGBOX, "Congratulations!", "You passed the roleplay test. Now, you will\n need to choose a few things about your character.", "Continue", "Cancel");
- }
- case 1:
- {
- if(WrongTestAnswers[playerid] > 0)
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You answered two questions wrong, so you have been kicked.");
- Kick(playerid);
- }
- else if(WrongTestAnswers[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "Wrong answer! If you answer two questions wrong, you will be kicked!");
- WrongTestAnswers[playerid] ++;
- ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "4. What is metagaming?", "A. Using OOC information IC.\nB. Alt Tabbing to avoid dying.\nC. Speaking in more than one language at a time.\nD. I don't know.", "Select", "Cancel");
- }
- }
- case 2:
- {
- if(WrongTestAnswers[playerid] > 0)
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You answered two questions wrong, so you have been kicked.");
- Kick(playerid);
- }
- else if(WrongTestAnswers[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "Wrong answer! If you answer two questions wrong, you will be kicked!");
- WrongTestAnswers[playerid] ++;
- ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "4. What is metagaming?", "A. Using OOC information IC.\nB. Alt Tabbing to avoid dying.\nC. Speaking in more than one language at a time.\nD. I don't know.", "Select", "Cancel");
- }
- }
- case 3:
- {
- if(WrongTestAnswers[playerid] > 0)
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You answered two questions wrong, so you have been kicked.");
- Kick(playerid);
- }
- else if(WrongTestAnswers[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "Wrong answer! If you answer two questions wrong, you will be kicked!");
- WrongTestAnswers[playerid] ++;
- ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "4. What is metagaming?", "A. Using OOC information IC.\nB. Alt Tabbing to avoid dying.\nC. Speaking in more than one language at a time.\nD. I don't know.", "Select", "Cancel");
- }
- }
- }
- }
- else if(response == 0)
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You must complete the test in order to spawn. You have been kicked for cancelling.");
- Kick(playerid);
- }
- }
- if(dialogid == 7)
- {
- if(response == 1)
- {
- SetPlayerPos(playerid, 257.9030,-40.5248,1002.0234);
- SetPlayerInterior(playerid, 14);
- SetPlayerCameraPos(playerid, 254.2984,-42.2291,1002.0308);
- ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "Character Details", "Gender\nClothing\nFighting Style\nFinished", "Select", "Cancel");
- }
- else if(response == 0)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "You have been kicked for failing to complete the character set up!");
- Kick(playerid);
- }
- }
- if(dialogid == 8)
- {
- if(response == 1)
- {
- switch(listitem)
- {
- case 0:
- {
- ShowPlayerDialog(playerid, 9, DIALOG_STYLE_LIST, "Select Your Gender", "Male\nFemale", "Select", "Back");
- }
- case 1:
- {
- ShowPlayerDialog(playerid,10,DIALOG_STYLE_INPUT,"Clothing","Type the skin ID you would like below.","Change","Cancel");
- }
- case 2:
- {
- SendClientMessage(playerid, COLOR_WHITE, "Under construction!");
- ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "Character Details", "Gender\nClothing\nFighting Style\nFinished", "Select", "Cancel");
- // ShowPlayerDialog(playerid,11,DIALOG_STYLE_LIST, "Choose Your Fighting Style", "Boxing\nKung Fu\nKneehead\nGrabkick\nElbow", "Select", "Back");
- }
- case 3:
- {
- PlayerInfo[playerid][Test] = 0;
- SetPlayerPos(playerid, -186.8255,977.1414,19.0608);
- SetPlayerInterior(playerid, 0);
- SetCameraBehindPlayer(playerid);
- TogglePlayerControllable(playerid, 1);
- SendClientMessage(playerid, COLOR_PURPLE, "** You step off the bus, and take your first step in Fort Carson.");
- SendClientMessage(playerid, COLOR_PURPLE, "** All you have is your wallet with your ID and $525.");
- GivePlayerMoney(playerid, 525);
- }
- }
- }
- else if(response == 0)
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You have been kicked for failing to complete the character set up.");
- Kick(playerid);
- }
- }
- if(dialogid == 9)
- {
- if(response == 1)
- {
- switch(listitem)
- {
- case 0:
- {
- PlayerInfo[playerid][Gender] = 1;
- SendClientMessage(playerid, COLOR_GRAD1, "You have set your gender as male.");
- ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "Character Details", "Gender\nClothing\nFighting Style\nFinished", "Select", "Cancel");
- }
- case 1:
- {
- PlayerInfo[playerid][Gender] = 2;
- SendClientMessage(playerid, COLOR_GRAD1, "You have set your gender as female.");
- ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "Character Details", "Gender\nClothing\nFighting Style\nFinished", "Select", "Cancel");
- }
- }
- }
- else if(response == 0)
- {
- ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "Character Details", "Gender\nClothing\nFighting Style\nFinished", "Select", "Cancel");
- }
- }
- if(response)
- {
- if(dialogid == 10)
- {
- if(!inputtext[0])
- {
- ShowPlayerDialog(playerid, 10, DIALOG_STYLE_INPUT, "Skin", "Type in your wanted skin id into the input box.", "Change", "Cancel");
- }
- else if(IsValidSkin(strval(inputtext)) == 0)
- {
- SendClientMessage(playerid, COLOR_GRAD1, "This is a restricted skin. Please pick another.");
- ShowPlayerDialog(playerid, 10, DIALOG_STYLE_INPUT, "Clothing", "Type the skin ID you would like below.", "Select", "Back");
- return 1;
- }
- SetPlayerSkin(playerid, strval(inputtext));
- SendClientMessage(playerid, COLOR_WHITE, "You have changed your skin!");
- ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "Character Details", "Gender\nClothing\nFighting Style\nFinished", "Select", "Cancel");
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment