FAST help
#1

I got problem
pawn Код:
CMD:jail(playerid,params[])
{
    new Message[128],id;
   
    if(PlayerInfo[playerid][pAdminLevel] < 4) return SendClientMessage(playerid,COLOR_GREY,"You are not allowed to use this command!");
    {
        if(sscanf(params, "s[128]", Message))SendClientMessage(playerid, COLOR_WHITE, "[CMD] / [PlayerID/PartOfName]");
        {
            if(IsPlayerConnected(id))return SendClientMessage(playerid, COLOR_WHITE, "Player Not Connected");
            {
                new gName[MAX_PLAYER_NAME],string[128];
                GetPlayerName(playerid,gName,sizeof gName);
                format(string,sizeof string,"You jailed %s",gName);
                SendClientMessage(playerid,0x00ff00ff,string);
                SendClientMessage(playerid,0xFF0000FF,"You have been jailed by admin.");
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,-9.6939,2336.7288,24.3034);
                ResetPlayerWeapons(playerid);
            }
        }
    }
    return 1;
}
when i use /jail allways Player Not Connected how to fix it please help me fast!
Reply
#2

if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /jail <playerid/partofname>");


Please look at this link..



pawn Код:
CMD:jail(playerid,params[])
{
    new id;

    if(PlayerInfo[playerid][pAdminLevel] < 4) return SendClientMessage(playerid,COLOR_GREY,"You are not allowed to use this command!");
    {
        if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "[CMD] / [PlayerID/PartOfName]");
       
        new gName[MAX_PLAYER_NAME],string[128];
        GetPlayerName(id,gName,sizeof gName);
        format(string,sizeof string,"You jailed %s",gName);
        SendClientMessage(playerid,0x00ff00ff,string);
        SendClientMessage(id,0xFF0000FF,"You have been jailed by admin.");
        SetPlayerInterior(id,0);
        SetPlayerPos(id,-9.6939,2336.7288,24.3034);
        ResetPlayerWeapons(id);
    }
    return 1;
}
Reply
#3

try this

Код:
CMD:jail(playerid,params[])
{
    new Message[128],id;
    
    if(PlayerInfo[playerid][pAdminLevel] < 4) return SendClientMessage(playerid,COLOR_GREY,"You are not allowed to use this command!");
    {
        if(sscanf(params, "uds[128]", Message))SendClientMessage(playerid, COLOR_WHITE, "[CMD] / [PlayerID/PartOfName]");
        {
            if(IsPlayerConnected(id))return SendClientMessage(playerid, COLOR_WHITE, "Player Not Connected");
            {
                new gName[MAX_PLAYER_NAME],string[128];
                GetPlayerName(playerid,gName,sizeof gName);
                format(string,sizeof string,"You jailed %s",gName);
                SendClientMessage(playerid,0x00ff00ff,string);
                SendClientMessage(playerid,0xFF0000FF,"You have been jailed by admin.");
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,-9.6939,2336.7288,24.3034);
                ResetPlayerWeapons(playerid);
            }
        }
    }
    return 1;
Reply
#4

Quote:
Originally Posted by N0FeaR
Посмотреть сообщение
try this

Код:
CMD:jail(playerid,params[])
{
    new Message[128],id;
    
    if(PlayerInfo[playerid][pAdminLevel] < 4) return SendClientMessage(playerid,COLOR_GREY,"You are not allowed to use this command!");
    {
        if(sscanf(params, "uds[128]", Message))SendClientMessage(playerid, COLOR_WHITE, "[CMD] / [PlayerID/PartOfName]");
        {
            if(IsPlayerConnected(id))return SendClientMessage(playerid, COLOR_WHITE, "Player Not Connected");
            {
                new gName[MAX_PLAYER_NAME],string[128];
                GetPlayerName(playerid,gName,sizeof gName);
                format(string,sizeof string,"You jailed %s",gName);
                SendClientMessage(playerid,0x00ff00ff,string);
                SendClientMessage(playerid,0xFF0000FF,"You have been jailed by admin.");
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,-9.6939,2336.7288,24.3034);
                ResetPlayerWeapons(playerid);
            }
        }
    }
    return 1;
uds would be...playerid/partofname, a number, and a string....
Reply
#5

if(IsPlayerConnected(id))return SendClientMessage(playerid, COLOR_WHITE, "Player Not Connected");

change to

if(!IsPlayerConnected(id))return SendClientMessage(playerid, COLOR_WHITE, "Player Not Connected");

i Think so :S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)