Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: SaFeeR on December 26, 2011, 04:34:38 pm
-
help
this cmd can use anyone
help
[pawn]else if (strcmp(cmd, "jail", true) == 0) {
IsPlayerAdmin( playerid );
{
new time[256],reason[256],plr;
tmp = strtok(cmdtext, idx),plr = FindPlayerIDFromString(tmp),time = strtok(cmdtext, idx),reason = strtok(cmdtext, idx);
if(Jail[plr] == 1) {
SendClientMessage(playerid,NOTACCES,"This Player Is In Jail !");
}
if(Jail[plr] == 0) {
if (!strlen(tmp) || !strlen(time) || !strlen(reason)) SendClientMessage(playerid,COLOR_RED, "USAGE: /c jail [Nick] [Min] [Reason]");
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
else {
new string[256];
SetPlayerRandomJailSpawns(plr);
SetPlayerWeapon(plr,0,0);
SetPlayerWeapon(plr,0,0);
SetPlayerWeapon(plr,0,0);
format(string,sizeof(string),"Admin %s has jailed %s for %d minutes.",gPlayers[playerid],gPlayers[plr],strval(time));
SendClientMessageToAll(COLOR_YELLOW, string);
format(string,sizeof(string),"Reason:[ %s ].",cmdtext[strlen(tmp)+7]);
SendClientMessageToAll(COLOR_YELLOW, string);
SendClientMessage(plr,COLOR_YELLOW,"You have been jailed !");
SetTimer("unjail",(strval(time)*60000),false);
Jail[plr] = 1;
TogglePlayerControllable(plr,0);
}
}
}
return 1;
}
else if(strcmp(cmd, "unjail", true) == 0) {
IsPlayerAdmin( playerid );
{
tmp = strtok(cmdtext, idx); new plr = FindPlayerIDFromString(tmp);
if(Jail[plr] == 0) {
SendClientMessage(playerid,NOTACCES,"This Player Is Not In Jail !");
}
if(Jail[plr] == 1) {
if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED, "USAGE: /c unjail [Nick]");
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);
SendClientMessage(plr,COLOR_YELLOW,"You have been unjailed !");
Jail[plr] = 0;
TogglePlayerControllable(plr,1);
}
else SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
}
}
}
return 1;
}[/pawn]
-
I Don't have time to see it line by Line but here's something i made when i used Pawn ( Warchiefs, This Works Fine for me ):
[pawn]
else if (strcmp(cmd, "jail", true) == 0) {
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
if (IsPlayerInfo(playerid,cmd)) return 0;
else if (!strlen(tmp)) MessagePM(playerid, GREEN,"[Syntax]: /c jail <Nick/id> <Reason>");
else if (plr == INACTIVE_PLAYER_ID) MessagePM(playerid, GREEN,"[Error] - Unknown player");
else {
MessageAllFormat(BLUE, "Admin %s jailed: [ %s ] Reason: [ %s ]",gPlayers[ playerid ], gPlayers[ plr ], cmdtext[ strlen( tmp ) +7 ]);
SetPlayerPos(plr,387.873, -509.743, 8.98706,0,0);
TogglePlayerControllable(plr,0);
SetPlayerWeapon(plr,0,0);
}
return 1;
[/pawn]
-
nice madkiller :)
mere pas hy ye jail
-
ok thanks
-
Where is unjail command ???
-
First, he only asked for Jail not Unjail command. Second, the script Mad gave, I was wondering how is player going to be released and why an admin not a cop???
-
Where is unjail command ???
yes where is ?
-
Just spotted a mistake.. ;D
[pawn]SetTimer("unjail",(strval(time)*60000),false);[/pawn]
Let me be straight with you...
YOU CAN'T SET A FREAKING TIMER TO A SPECIFIC PERSON IN PAWN!!!