• Welcome to Vice City Multiplayer.
 

Simple Jail System By Moby (me) !

Started by sseebbyy, March 17, 2011, 09:22:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sseebbyy

SIMPLE JAIL SYSTEM


This is Include ! By [RBS]Moby (me) !

Commands: /c jail [Nick/ID] , /c unjail [Nick/ID] => Commands for rcon admins !

Type on your gm top this:

new Jail[MAX_PLAYERS];

Now, add Commands !

Jail Command:


else if (strcmp(cmd, "jail", true) == 0) {
   if(IsPlayerAdmin(playerid))
   {
   new plr = FindPlayerIDFromString(tmp);
   if(Jail[plr] == 1) {
   SendClientMessage(playerid,COLOR_RED,"This Player Is In Jail !");
   }
   if(Jail[plr] == 0) {
tmp = strtok(cmdtext, idx);
if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED, "USAGE: /c jail [Nick/ID]");
else {
new string[256];
    if (plr != INACTIVE_PLAYER_ID) {
SetPlayerPos(plr,387.873, -509.743, 8.98706,0,0);
SetPlayerWeapon(plr,0,0);
SetPlayerWeapon(plr,0,0);
SetPlayerWeapon(plr,0,0);
TogglePlayerControllable(plr,0);
RemovePlayerMarker(plr);
format(string,sizeof(string),"Admin %s has jailed %s",gPlayers[playerid],gPlayers[plr]);
SendClientMessageToAll(COLOR_YELLOW, string);
SendClientMessage(plr,COLOR_YELLOW,"You have been jailed!");
                               SendClientMessage(plr,COLOR_YELLOW,"[Jail System By [RBS]Moby]");
Jail[plr] = 1;
}
else SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
}
}
}else{
SendClientMessage(playerid,COLOR_RED,"***Not have permission to use this command!");
}
return 1;
}


And UnJail Command :

else if(strcmp(cmd, "unjail", true) == 0) {
   if(IsPlayerAdmin(playerid))
   {
   tmp = strtok(cmdtext, idx);
   new plr = FindPlayerIDFromString(tmp);
   if(Jail[plr] == 0) {
   SendClientMessage(playerid,COLOR_RED,"This Player Is Not In Jail !");
   }
   if(Jail[plr] == 1) {
   if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED, "USAGE: /c unjail [Nick/ID]");
   else{
       if (plr != INACTIVE_PLAYER_ID) {
           new string[256];
        format(string,sizeof(string),"Admin %s has unjailed %s!",gPlayers[playerid],gPlayers[plr]);
SendClientMessageToAll(COLOR_YELLOW, string);
SetPlayerPos(plr,397.688, -471.821, 11.5172,0,0);
TogglePlayerControllable(plr,1);
SetPlayerMarker(plr,1);
SendClientMessage(plr,COLOR_YELLOW,"You have been unjailed!");
                               SendClientMessage(plr,COLOR_YELLOW,"[Jail System By [RBS]Moby]");
Jail[plr] = 0;
}
else SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
}
}
}else{
SendClientMessage(playerid,COLOR_RED,"***Not have permission to use this command!");
}
return 1;
}



Finish !




Madara


sseebbyy

#2
thanx  ;D

BIG[H]

huh that is soo easy well its [Fine for newbies] !
My Guru FORUM MUST VISITmegavcmp.freeforums.org

BIG[H] = BIG HaLL

yazeen

This is so easy man . when i saw topic jail system i thought of the argonath type jail system

sseebbyy


yazeen

Same Man If ur beggining You will be pro within days Best Of Luck

;) ;)

DRACULA346

a question. where is the first code? sorry but I am beginner in PAWN: P

sseebbyy

#8
Jail and Unjail is the Commands for jailed or unjailed player


tato






<!-- Facebook Badge START --><a href="http://es-es.facebook.com/eduardoeslindo" target="_TOP" style="font-family: &quot;lucida grande&quot;,tahoma,verdana,arial,sans-serif; font-size: 11px; font-variant: normal; font-style: normal; font-weight: normal; color: #3B5998; text-decoration: none;" title="Eduardo Estrada">Eduardo Estrada</a><br/><a href="http://es-es.facebook.com/eduardoeslindo" target="_TOP" title="Eduardo Estrada"><img src="http://badge.facebook.com/badge/697470158.6069.1979465113.png" width="120" height="272" style="b


Robd

#11
For argo jail system
enum pInfo
{
   jail,
   cop
}
new PlayerInfo[MAX_PLAYERS][pInfo];
new gPlayers[MAX_PLAYERS][MAX_PLAYER_NAME+1];


OnPlayerConnect(playerid)
{
   GetPlayerName(playerid,gPlayers[playerid],MAX_PLAYER_NAME);
}

OnPlayerCommandText(playerid,cmdtext[])
{
   new cmd[256],tmp[256],idx;
   cmd = strtok(cmdtext,idx);
   if (strcmp(cmd, "cop", true) == 0) {
       if(PlayerInfo[playerid][jail] != 0) SendClientMessage(playerid,COLOR,"You cannot become a cop from jail");
       else {
            new szMsg[256];
            format(szMsg,sizeof(szMsg),"%s has joined VCPD",gPlayers[playerid]);
             SendClientMessageToAll(COLOR_GREEN,szMsg);
            PlayerInfo[playerid][cop] = 1;
       }
       return 1;
   }
   else if (strcmp(cmd, "jail", true) == 0) {
       tmp = strtok(cmdtext,idx);
       new plr;
       plr = FindPlayerIDFromString(tmp);
       if(!strlen(tmp)) SendClientMessage(playerid,COLOR_GREEN,"Use /c jail <Nick/ID>");
       else if(plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR,"Unknown player");
       else if(PlayerInfop[playerid][cop] != 1) SendClientMessage(playerid,COLOR_GREEN,"Only cops can jail");
       else {
           PlayerInfo[plr][jail] = 1;
           SendClientMessage(plr,COLOR_GREEN,"You have been jailed");
       }
       return 1;
   }
   else if (strcmp(cmd, "unjail", true) == 0) {
       tmp = strtok(cmdtext,idx);
       new plr;
       plr = FindPlayerIDFromString(tmp);
       if(!strlen(tmp)) SendClientMessage(playerid,COLOR_GREEN,"Use /c jail <Nick/ID>");
       else if(plr == INACTIVE_PLAYER_ID) SendClientMEssage(playerid,COLOR,"Unknown player");
       else if(PlayerInfo[playerid][cop] != 1) SendClientMessage(playerid,COLOR_GREEN,"Only cops can unjail");
       else {
           PlayerInfo[plr][jail] = 0;
           SendClientMessage(plr,COLOR_GREEN,"You have been unjailed");
       }
       return 1;
}


OnGameModInit()
{
   SetTimer(jailsystem,1000,true);
}



public jailsystem()
{
   for(new i = 0; i <= MAX_PLAYERS; i++) {
       if(IsPlayerConnected(i) == 1 && GetDistance(playerid,387.45043945,-504.51019287,9.39638042) > 5 && PlayerInfo[playerid][jail] == 1) SetPlayerPos(i,387.45043945,-504.51019287,9.39638042,0,0);
}
Hello, this is Robd from the past.
If you are seeing this I have either posted something stupid, forgotten something, started a stupid topic, or a combination of the three.

Please forgive us for this mistake.

Regards, management