Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <admin_menu>
- new count, counter = 120;
- new jail[MAX_PLAYERS];
- forward Count(playerid);
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/jailme", cmdtext, true, 10) == 0)
- {
- ResetPlayerWeapons(playerid);
- SetCameraBehindPlayer(playerid);
- SetPlayerInterior(playerid,3);
- SetPlayerPos(playerid,194.0873,175.3850,1003.0234);
- SetPlayerFacingAngle(playerid,20.7011);
- new name[MAX_PLAYER_NAME], string[44];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "**(AUTO JAIL)** %s(%d) Do NOT Driveby players who is on foot, Read /rules /pc /commands",name ,playerid);
- SendClientMessageToAll(COLOR_ADMINORANGE, string);
- count = SetTimer("Count", 1000, true);
- jail[playerid] = 1;
- return 1;
- }
- else SendClientMessage(playerid, 0x94FF00FF, "Player is already in jail");
- if (strcmp("/kill", cmdtext, true, 10) == 0)
- {
- if(jail[playerid] == 1)//checks if is in jail.
- {
- SendClientMessage(playerid,COLOR_YOURCHOICE,"You are jailed and may not suicide!");
- }
- else
- {
- new name[MAX_PLAYER_NAME], string[44];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s(%d) has committed suicide.",name ,playerid);
- SendClientMessageToAll(0xFFFF00AA, string);
- SetPlayerHealth(playerid, 0);
- SetPlayerScore(playerid, GetPlayerScore(playerid)-1);
- }
- return 1;
- }
- return 0;
- }
- public Count(playerid)
- {
- new string[128];
- counter--;
- format(string, sizeof(string), "JAILTIME: %d",counter);
- GameTextForPlayer(playerid, string, 3000,6);
- if(counter == 0)
- {
- SetPlayerInterior(playerid,3);
- SetPlayerPos(playerid,210.5272,146.3341,1003.0234);
- SetPlayerFacingAngle(playerid,179.4662);
- SetCameraBehindPlayer(playerid);
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s(%d) *Released from jail*",name ,playerid);
- SendClientMessageToAll(COLOR_RED, string);
- KillTimer(count);
- jail[playerid] = 0;//sets variable back to 0, so you can suicide if your not in jail.
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement