[HELP] Jail works only for ID 0...
#1

pawn Код:
dcmd_jail(playerid, params[])
{
    new ReturnPlayer, ppName[24], ReturnUserName[24], str[128];
    if(PlayerInfo[playerid][AdminLevel] < 1) return false;
    if(sscanf(params, "dd", ReturnPlayer, JailMins[ReturnPlayer])) return SendClientMessage(playerid, mwhite, "Usage: /jail [playerid] [mins]");
    if(!IsPlayerConnected(ReturnPlayer)) return SendClientMessage(playerid, mbrightred, "Invalid playerid.");
    if(PlayerIsJailed[ReturnPlayer] == 1) return SendClientMessage(playerid, mbrightred, "That player is jailed already.");

    GetPlayerName(playerid, ppName, sizeof(ppName));
    GetPlayerName(ReturnPlayer, ReturnUserName, sizeof(ReturnUserName));

    format(str, sizeof(str), "You have been jailed for %d minutes!", JailMins[ReturnPlayer]);
    SendClientMessage(ReturnPlayer, COLOR_RED, str);
    SendClientMessage(ReturnPlayer, COLOR_RED, "Commands are disabled untill you get unjailed.");

    format(str, sizeof(str), "Mod Message: %s (ID: %d) has jailed %s (ID: %d) for %d minutes.", ppName, playerid, ReturnUserName, ReturnPlayer, JailMins[ReturnPlayer]);
    SendModMsg(mwhite, str);

    JailTimerEx[ReturnPlayer] = SetTimerEx("JailTimer", 60000, 1, "d", ReturnPlayer);

    SetPlayerInterior(ReturnPlayer,3);
    SetPlayerVirtualWorld(ReturnPlayer,990);
    PlayerIsJailed[ReturnPlayer] = 1;

    return 1;
}
Well, it doesn't set JailMins[playerid] for other IDs (except 0). Only works for ID 0. When i jail ID 0 for 2 mins, it says "You have been jailed for 2 minutes!", but when i jail ID 1, it can't set JailMins[playerid], so it says that "You have been jailed for 0 minutes!"...

How to fix?
Reply


Messages In This Thread
[HELP] Jail works only for ID 0... - by LasTRace - 12.08.2010, 17:44
Re: [HELP] Jail works only for ID 0... - by JaTochNietDan - 12.08.2010, 17:48
Re: [HELP] Jail works only for ID 0... - by LasTRace - 12.08.2010, 17:53
Re: [HELP] Jail works only for ID 0... - by LasTRace - 12.08.2010, 17:57
Re: [HELP] Jail works only for ID 0... - by JaTochNietDan - 12.08.2010, 18:05
Re: [HELP] Jail works only for ID 0... - by LasTRace - 12.08.2010, 18:09

Forum Jump:


Users browsing this thread: 1 Guest(s)