Sergey_BMW
Новичок
Помогите сажу в тюрьму я игрока он перезаходит и он на свободе, вот код посмотрите может что не так или проблема в другой я скину что надо!!!
PHP:
if(strcmp(cmd, "/jail", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "/jail [playerid/PartOfName] [âðåìÿ(ìèíóòû)][ïðè÷èíà]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "/jail [playerid/PartOfName] [âðåìÿ(ìèíóòû)][ïðè÷èíà]");
return 1;
}
if(PlayerInfo[playerid][pJailed] == 1 || PlayerInfo[playerid][pJaileda] == 1 || PlayerInfo[playerid][pJailedlv] == 1)
{
SendClientMessage(playerid, COLOR_GRAD1, "{ff3300}[Îøèáêà]{FFFFFF}: Ýòîò èãðîê óæå ñèäèò!");
return 1;
}
new arank[64];
if(PlayerInfo[playerid][pAdmin] == 6) { arank = "Ãë.Àäìèíèñòðàòîðîì"; }
else if(PlayerInfo[playerid][pAdmin] == 5) { arank = "Ãë.Àäìèíèñòðàòîðîì"; }
else if(PlayerInfo[playerid][pAdmin] == 4) { arank = "Ãë.Ìîäåðàòîðîì"; }
else if(PlayerInfo[playerid][pAdmin] == 3) { arank = "Ìîäåðàòîðîì"; }
else if(PlayerInfo[playerid][pAdmin] == 2) { arank = "Ìîäåðàòîðîì"; }
else if(PlayerInfo[playerid][pAdmin] == 1) { arank = "Ìîäåðàòîðîì"; }
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[playa][pWanted] = 0; SetPlayerWantedLevel(playa, PlayerInfo[playa][pWanted]);
PlayerInfo[playa][pJaileda] = 1;
PlayerInfo[playa][pJailTimea] = money*60;
SpawnPlayer(playa);
format(string, sizeof(string), "%s áûë(a) ïîñàæåí(a) â òþðüìó íà %d ìèíóò %s %s. Ïðè÷èíà: %s.",giveplayer,money,arank,sendername,(result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
format(string, sizeof(string), "Âû ïîñàæåíû â òþðüìó íà %d ìèíóò %s %s. Ïðè÷èíà: %s.",money,arank,sendername,(result));
SendClientMessage(playa, COLOR_LIGHTBLUE, string);
ServerResetPlayerWeaponsAC(playa);
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(GainAdmin[i] == 1)
{
new admin[MAX_PLAYER_NAME]; new player[MAX_PLAYER_NAME];
GetPlayerName(playerid, admin,sizeof(admin));
GetPlayerName(playa, player,sizeof(player));
if(money >= 1)
{
if(playerid == playa)
{
format(string,sizeof(string),"Gain Admin: {FFFFFF}%s ïîñàäèë ñåáÿ íà %d ñåêóíä.",admin, PlayerInfo[playerid][pJailTime]);
}
else
{
format(string,sizeof(string),"Gain Admin: {FFFFFF}%s ïîñàäèë èãðîêà %s íà %d ñåêóíä.",admin,player, PlayerInfo[playa][pJailTime]);
}
}
if(money == 0)
{
if(playerid == playa)
{
format(string,sizeof(string),"Gain Admin: {FFFFFF}%s âûïóñòèë ñåáÿ èç òþðüìû.",admin);
}
else
{
format(string,sizeof(string),"Gain Admin: {FFFFFF}%s âûïóñòèë èãðîêà %s èç òþðüìû.",admin,player, PlayerInfo[playa][pJailTime]);
}
}
SendClientMessage(i, COLOR_LIGHTRED, string);
}
}
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Íåäîñòàòî÷íî ïðàâ äëÿ èñïîëüçîâàíèÿ êîìàíäû.");
}
}
return 1;
}
