10.06.2009, 00:08
Hello,
This is my /jail script,
Does anyone has a idea where I can change the pos of where to put people in jail from.
This is my /jail script,
pawn Код:
if(strcmp(cmd, "/jail", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /jail");
return 1;
}
giveplayerid = strval(tmp);
if(JailTime[giveplayerid] > 0 || gTeam[giveplayerid] != 4)
{
SendClientMessage(playerid, COLOR_GRAD2, " That person can't be jailed right now.");
printf("JailTime[giveplayerid](%d) gTeam[giveplayerid](%d)",JailTime[giveplayerid],gTeam[giveplayerid]);
return 1;
}
if (IsPlayerConnected(giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if (gTeam[playerid] == TEAM_BLUE)
{
if (TestDistance(playerid,giveplayerid,264.395200,77.564040,1001.039000,7))
{
//print("DEBUG Distancetested");
new slice = ((PlayerInfo[giveplayerid][pLevel]*deathcost)+(1000)); //1k +your level
SetPlayerPos(giveplayerid,264.395200,77.564040,1001.039000);
GivePlayerMoney(playerid, slice);
GivePlayerMoney(giveplayerid, -slice);
PlayJailSound(1165 , 1166, 2000,264.395200, 77.564040, 1001.039000);
format(string, sizeof(string), "~r~Suspect ~w~Detained~n~You Get ~g~$%d", slice);
GameTextForPlayer(playerid, string, 5000, 1);
format(string, sizeof(string), "~r~JAIL~n~~w~You Are fined ~n~~r~$%d", -slice);
GameTextForPlayer(giveplayerid, string, 5000, 1);
PlayerPlayMusic(playerid);
JailTime[giveplayerid] = jailtime;
SetPlayerFree(giveplayerid,playerid,"Serving Prison Sentence",0,0);
if(FlashTime[giveplayerid] == 0){FlashTime[giveplayerid] = 10;}
TogglePlayerControllable(giveplayerid, 1);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " one of you is to far away from a jail cell!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
return 1;
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
return 1;
}