22.03.2009, 13:28
So, i have a jail command for cops , but it doesn't work ... :/
When I type /copjail [ID] it says unknown command , and when i type /copjail says the way how to use.
Help ?
Code:
Unjail:
Unjail Warning:
When I type /copjail [ID] it says unknown command , and when i type /copjail says the way how to use.
Help ?
Code:
Код:
if(strcmp(cmdtext, "/copjail", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREEN, "Use: /copjail [Player ID]");
return 1;
}
giveplayerid = strval(tmp);
if(jailed[giveplayerid]==0)
{
if (gTeam[playerid] == COPS)
{
if (IsPlayerConnected(giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "You have been jailed by officer %s!", sendername, playerid);
SendClientMessage(giveplayerid, COLOR_RED1, string);
format(string, sizeof(string), "%s has been jailed by %s!", giveplayer, giveplayerid, sendername, playerid);
SendClientMessageToAll(COLOR_RED1, string);
printf(string);
SetPlayerInterior(giveplayerid,3);
jailed[giveplayerid] = 1;
SetPlayerPos(giveplayerid,198.3797,160.8905,1003.0300);
SetPlayerFacingAngle(giveplayerid,177.0350);
SetCameraBehindPlayer(giveplayerid);
PlayerPlaySound(giveplayerid,1082,198.3797,160.8905,1003.0300);
TogglePlayerControllable(giveplayerid,0); //So the player that is jailed can't use /kill
DisablePlayerCheckpoint(giveplayerid);
SetTimerEx("UnJail",180000,true,"d",playerid);
return 1;
}else{
format(string, sizeof(string), "ID %d is not connected.", giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
}else{
format(string, sizeof(string), "You are not a cop", giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
}else{
format(string, sizeof(string), "He/She is already jailed", giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
}
return 0;
}
Код:
public UnJail(playerid)
{
if(jailed[playerid] == 1)
{
SetPlayerPos(playerid,197.1827,179.1550,1003.0234);
jailed[playerid] == 0;
SendClientMessage(playerid, COLOR_RED,"SERVER: You've been unjailed .");
}
}
Код:
C:\DOCUME~1\Gustavo\Desktop\SAMP02~1.WIN\GAMEMO~1\LVCNR.pwn(530) : warning 215: expression has no effect Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warnings.
Код:
Line 530: jailed[playerid] == 0;



?