What i am doing wrong here?
#8

You just need to add "new szString[128+MAX_PLAYER_NAME]" to the variable list;
pawn Код:
CMD:jail(playerid,params[]){
    if(IsPlayerAdmin(playerid)) {
        new id,time,reason[100],PlayerName[MAX_PLAYER_NAME],GPlayerName[MAX_PLAYER_NAME], szString[128+MAX_PLAYER_NAME];
        if(sscanf(params,"dds",id,time,reason)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /jail <playerid> <time> <reason>");
        if (!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: Player is not connected.");
        if(Jailed[id] == 1) return SendClientMessage(playerid, red, "ERROR: Player is already jailed.");
        GetPlayerName(id, PlayerName, sizeof(PlayerName));
        GetPlayerName(playerid, GPlayerName, sizeof(GPlayerName));
        format(szString, sizeof(szString), "AdmSys-: %s (ID:%d) has been jailed for %d minutes; Reason: %s", PlayerName, id, time, reason);
        SendClientMessageToAll(0xFFFFFFFF, szString);
        SetPlayerInterior(id, 3);
        SetPlayerVirtualWorld(id, 10);
        SetPlayerFacingAngle(id, 360.0);
        SetPlayerPos(id, 197.5662, 175.4800, 1004.0);
        SetPlayerHealth(id, 9999999999.0);
        ResetPlayerWeapons(id);
        JailTimer[id] = SetTimerEx("Unjail",time*60000, false, "i", id);
    }
    else {
        SendClientMessage(playerid, 0xFFFFFFFF, "You're not an admin.");
    }
    return 1;
}
Reply


Messages In This Thread
What i am doing wrong here? - by Nabster - 11.02.2015, 12:20
Re: What i am doing wrong here? - by ATGOggy - 11.02.2015, 12:33
Re: What i am doing wrong here? - by Luis- - 11.02.2015, 12:34
Re: What i am doing wrong here? - by caoraivoso3 - 11.02.2015, 12:37
Re: What i am doing wrong here? - by Nabster - 11.02.2015, 12:44
Re: What i am doing wrong here? - by Luis- - 11.02.2015, 12:47
Re: What i am doing wrong here? - by Nabster - 11.02.2015, 12:49
Re: What i am doing wrong here? - by Luis- - 11.02.2015, 12:51
Re: What i am doing wrong here? - by Nabster - 11.02.2015, 12:55
Re: What i am doing wrong here? - by Luis- - 11.02.2015, 13:00

Forum Jump:


Users browsing this thread: 2 Guest(s)