I don't get the chaotic gameplay... the only good thing about the gameplay is the fact that there are 12 million people there. What I don't get is why they come to begin with...
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menuenum 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);
}