Error?
#2

Try that:
PHP код:
COMMAND:jail(playeridparams[])
{
    new 
text[128],time,targetid,string[256],sendername[MAX_PLAYER_NAME],giveplayer[MAX_PLAYER_NAME];
    if(
sscanf(params"uis[128]"targetidtimetext)) SendClientMessage(playeridCOLOR_GREY"USAGE: /jail [playerid] [minutes] [reason]");
    else
    {
        if (
GetPVarInt(playerid"PlayerLogged") == 0) return SendClientMessage(playeridCOLOR_WHITE"You must be logged in to use this.");
        if (!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_WHITE"This player is not connected !");
        if(
IsPlayerNPC(targetid)) return SendClientMessage(playeridCOLOR_GREY"Can't do this to a NPC.");
        if(
strlen(text) >= 100) return SendClientMessage(playeridCOLOR_WHITE"Reason is too long.");
        if(
GetPVarInt(playerid"Admin") >= 2)
        {
               
format(sendernamesizeof(sendername), "%s"AdminName(playerid));
              
format(giveplayersizeof(giveplayer), "%s"PlayerName(targetid));
              
GiveNameSpace(sendername);
              
GiveNameSpace(giveplayer);
              
format(stringsizeof(string), "AdmCmd: %s was jailed by %s, reason: %s"giveplayersendernametext);
            
SendAdminMessage(COLOR_LIGHTREDstring);
            
SetPVarInt(targetid"Jailed"2);
            
SetPVarInt(targetid"JailTime"time*60);
            
strmid(PlayerInfo[targetid][pJailReason], text0strlen(text), 255);
            
format(stringsizeof(string), "You are jailed for %d minutes."time);
            
SendClientMessage(targetidCOLOR_WHITEstring);
            
format(stringsizeof(string), "REASON: %s."text);
            
SendClientMessage(targetidCOLOR_WHITEstring);
            
SetPlayerPos(targetid,2523.9197,-1673.8944,14.8589);
            
TogglePlayerControllableEx(targetidfalse);
            
SetPlayerInterior(targetid0);
            
SetPlayerVirtualWorld(targetidtargetid);
            
SetPVarInt(targetid"Jails"GetPVarInt(targetid"Jails")+1);
            
SetPVarInt(targetid"Mute"1);
        }
        else
        {
            
SendClientMessage(playeridCOLOR_LIGHTRED"You do not have access to this command !");
        }
    return 
1;

Reply


Messages In This Thread
Error? - by DGRP - 22.08.2015, 13:20
Re: Error? - by jlalt - 22.08.2015, 13:29
Re : Re: Error? - by DGRP - 22.08.2015, 13:38
Re : Error? - by DGRP - 22.08.2015, 13:58

Forum Jump:


Users browsing this thread: 2 Guest(s)