Need help ! ^^
#1

FIRST HELP :
pawn Код:
COMMAND:moveafk(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xDEEE20FF, "You not in RCON.");
    new gsendid;
    new string[256];
    new str[256];
    new PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
    if(sscanf(params, "u",gsendid))return SendClientMessage(playerid,COLOR_LIGHTRED, "Usage: {CC0099}/moveafk [ID]");
    else if(gsendid == INVALID_PLAYER_ID)return SendClientMessage(playerid, COLOR_LIGHTRED, "{9999CC}Player not found!");
    else
    {
        TogglePlayerControllable(playerid, 0);
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(str, sizeof(str), "INFO: %s is puted AFK by admin .", sendername);
        SendClientMessageToAll(COLOR_BRIGHTRED, str);
        SendClientMessage(playerid, COLOR_WHITE, "Admin put you AFK. Use /back to come back in the game.");
        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(playerid) + 123);
        LoopingAnim(playerid,"BEACH", "bather", 4.0, 1, 0, 0, 0, 0);
        AFK[playerid] = 1;
        format(string, sizeof(string), "~w~ADMIN PUT ~b~YOU ~r~AFK");
        GameTextForPlayer(playerid, string, 5000, 3);
        PlayerPlaySound(playerid, 1076, 0.0, 0.0, 0.0);
        SetPlayerAttachedObject(playerid, SLOT, 18645, 2, 0.079999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000);
    }
    if(AFK[playerid] == 0)
    {
        SendClientMessage(playerid, COLOR_WHITE, "He is AFK. He need to use /back.");
        return 1;
    }
    return 1;
}
I want like admin can put you in afk, but when i use that CMD, i go afk, but i want that, like admin can put you afk .

Second help .
I make cmd like /zombiec, /zombiek, /zombied . Now i want to make that all in dialog, but, i dont know, how i can type ID, in dialog . 1 cmd is like that :
pawn Код:
COMMAND:zombiec(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xDEEE20FF, "You not in RCON.");
    new gsendid;
    new string[256];
    new PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
    if(sscanf(params, "u",gsendid))return SendClientMessage(playerid,Color_Red, "Usage: {CC0099}/zombiec [ID]");
    else if(gsendid == INVALID_PLAYER_ID)return SendClientMessage(playerid, Color_Red, "{9999CC}Player not found!");
    else
    {
        format(string,sizeof(string),"Admin %s {3333FF}has make | NEW CHAINSAW ZOMBIE |!{663333} Watch color on map!",PlayerName);
        SendClientMessageToAll(COLOR_LIGHTBLUE,string);
        format(string, sizeof(string), "~w~We have ~b~new~y~[]CHAINSAW ZOMBIE]");
        GameTextForAll( string, 5000, 3 );
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon(gsendid, 9, 999);
        Zombie[ playerid ] = Create3DTextLabel("{33FF66}I'M{FF3300} CHAINSAW {6633FF}ZOMBIE.",-1,30.0,40.0,50.0,40.0,0);
        Attach3DTextLabelToPlayer( Zombie[ playerid ], playerid, 0.0, 0.0, 0.7);
        SetPlayerHealth(gsendid, 999);
        SetPlayerColor(gsendid, 0xFF6600AA);
        SetPlayerSkin(gsendid, 137);
        Delete3DTextLabel( Knife[ playerid ] );
        Delete3DTextLabel( Dildo[ playerid ] );
        Delete3DTextLabel( Shovel[ playerid ] );
    }
    return 1;
}
Now, i maked CMD :
pawn Код:
COMMAND:zombie(playerid, params[])
{
    SendClientMessage(playerid, 0xFFFFFFFF, "Choose, what zombie you want .");
    ShowPlayerDialog(playerid, 9990, DIALOG_STYLE_LIST, "Zombies", "Zombie with chainsaw\nZombie with knife\nZombie with dildo\nZombie help","Make", "Cancel");
    return 1;
}
Then i make dialog, like that :

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 9990)
    {
        if(response)
        {
          if(listitem == 0)//ZombieC
            {
                new Str[128];
                ShowPlayerDialog(playerid, 9991,DIALOG_STYLE_INPUT,"Type ID!", Str, "Zombie","Cancel");
            }
And next dialog like that :
pawn Код:
if(dialogid == 9991)
    {
        if(response)
        {
            new gsendid;
            new string[256];
            new PlayerName[MAX_PLAYER_NAME];
            GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
            if ( !sscanf( inputtext, "u", inputtext[ 0 ] ) )
            if(gsendid == INVALID_PLAYER_ID)return SendClientMessage(playerid, Color_Red, "{9999CC}Player not found!");
            else
            {
                format(string,sizeof(string),"Admin %s {3333FF}has make | NEW CHAINSAW ZOMBIE |!{663333} Watch color on map!",PlayerName);
                SendClientMessageToAll(COLOR_LIGHTBLUE,string);
                format(string, sizeof(string), "~w~We have ~b~new~y~[]CHAINSAW ZOMBIE]");
                GameTextForAll( string, 5000, 3 );
                ResetPlayerWeapons(playerid);
                GivePlayerWeapon(gsendid, 9, 999);
                Zombie[ playerid ] = Create3DTextLabel("{33FF66}I'M{FF3300} CHAINSAW {6633FF}ZOMBIE.",-1,30.0,40.0,50.0,40.0,0);
                Attach3DTextLabelToPlayer( Zombie[ playerid ], playerid, 0.0, 0.0, 0.7);
                SetPlayerHealth(gsendid, 999);
                SetPlayerColor(gsendid, 0xFF6600AA);
                SetPlayerSkin(gsendid, 137);
                Delete3DTextLabel( Knife[ playerid ] );
                Delete3DTextLabel( Dildo[ playerid ] );
                Delete3DTextLabel( Shovel[ playerid ] );
            }
            return 1;
        }
        return 0;
    }
Thats not correct, i know, because i ask help
PLZ HELP WITH ALL ... I am beginner, and SRY ABOUT BAD ENGLISH !

AND PS: I MAKED THAT IN FS !
Reply
#2

pawn Код:
COMMAND:moveafk(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xDEEE20FF, "You not in RCON.");
    new gsendid;
    new string[256];
    new str[256];
    new PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
    if(sscanf(params, "u",gsendid))return SendClientMessage(playerid,COLOR_LIGHTRED, "Usage: {CC0099}/moveafk [ID]");
    else if(gsendid == INVALID_PLAYER_ID)return SendClientMessage(playerid, COLOR_LIGHTRED, "{9999CC}Player not found!");
    else
    {
        TogglePlayerControllable(gsendid, 0);
        GetPlayerName(gsendid, sendername, sizeof(sendername));
        format(str, sizeof(str), "INFO: %s is puted AFK by admin .", sendername);
        SendClientMessageToAll(COLOR_BRIGHTRED, str);
        SendClientMessage(gsendid, COLOR_WHITE, "Admin put you AFK. Use /back to come back in the game.");
        SetPlayerVirtualWorld(gsendid, GetPlayerVirtualWorld(playerid) + 123);
        LoopingAnim(gsendid,"BEACH", "bather", 4.0, 1, 0, 0, 0, 0);
        AFK[gsendid] = 1;
        format(string, sizeof(string), "~w~ADMIN PUT ~b~YOU ~r~AFK");
        GameTextForPlayer(gsendid, string, 5000, 3);
        PlayerPlaySound(gsendid, 1076, 0.0, 0.0, 0.0);
        SetPlayerAttachedObject(gsendid, SLOT, 18645, 2, 0.079999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000);
    }
    if(AFK[gsendid] == 0)
    {
        SendClientMessage(playerid, COLOR_WHITE, "He is AFK. He need to use /back.");
        return 1;
    }
    return 1;
}
Reply
#3

Thx, /moveafk work now, but, that dialog not :S
Reply
#4

for last dialog replace this
pawn Код:
if ( !sscanf( inputtext, "u", inputtext[ 0 ] ) )
with this
pawn Код:
if ( !sscanf( inputtext, "u", gsendid ) )
I dont know what type of sscanf you are using.. so if that wont work try to remove `!`
Reply
#5

Im using sscanf2, but if i make that :

pawn Код:
if(dialogid == 9991)
    {
        //if(response)
        {
            new gsendid;
            new string[256];
            new PlayerName[MAX_PLAYER_NAME];
            GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
            if (sscanf( inputtext, "u",gsendid))
            if(gsendid == INVALID_PLAYER_ID)return SendClientMessage(playerid, Color_Red, "{9999CC}Player not found!");
            else
            {
                format(string,sizeof(string),"Admin %s {3333FF}has make | NEW CHAINSAW ZOMBIE |!{663333} Watch color on map!",PlayerName);
                SendClientMessageToAll(COLOR_LIGHTBLUE,string);
                format(string, sizeof(string), "~w~We have ~b~new~y~[]CHAINSAW ZOMBIE]");
                GameTextForAll( string, 5000, 3 );
                ResetPlayerWeapons(playerid);
                GivePlayerWeapon(gsendid, 9, 999);
                Zombie[ playerid ] = Create3DTextLabel("{33FF66}I'M{FF3300} CHAINSAW {6633FF}ZOMBIE.",-1,30.0,40.0,50.0,40.0,0);
                Attach3DTextLabelToPlayer( Zombie[ playerid ], playerid, 0.0, 0.0, 0.7);
                SetPlayerHealth(gsendid, 999);
                SetPlayerColor(gsendid, 0xFF6600AA);
                SetPlayerSkin(gsendid, 137);
                Delete3DTextLabel( Knife[ playerid ] );
                Delete3DTextLabel( Dildo[ playerid ] );
                Delete3DTextLabel( Shovel[ playerid ] );
                return 1;
            }
        }
    }
    return 0;
}
It didint work :S'

I dont need to add like #defline DIALOGID 9990 ? I need to add that ?
Reply
#6

Can someone make me that dialog ? Like first is LIST dialog, and then come the ID dialog, ? PLz ...
Reply
#7

All you needcan be found here:

https://sampwiki.blast.hk/wiki/ShowPlayerDialog

https://sampwiki.blast.hk/wiki/OnDialogResponse
Reply
#8

But, if i have maked like this :
pawn Код:
COMMAND:zombie(playerid, params[])
{
    ShowPlayerDialog(playerid, 9990, DIALOG_STYLE_LIST, "{003399}Z{00FF66}ombies", "{6600CC}Zombie With Chainsaw\n{990033}Zombie With Knife\n{339933}Zombie With Dildo\n{FFCC33}Kill Zombie\n{CC66CC}Zombie Help","Next", "Cancel");
    return 1;
}
Then :

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 9990)
    {
        if(response)
        {
            if(listitem == 0)//ZombieC
            {
                new Str[128];
                ShowPlayerDialog(playerid, 9991,DIALOG_STYLE_INPUT,"Type ID!", Str, "Zombie","Cancel");
            }
        }
    }
And then :

pawn Код:
if(dialogid == 9991)
    {
        if(response)
        {
            new knife;
            new string[256];
            new PlayerName[MAX_PLAYER_NAME];
            GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
            if (sscanf( inputtext, "u", knife ) )
            if(gsendid == INVALID_PLAYER_ID)return SendClientMessage(playerid, Color_Red, "{9999CC}Player not found!");
            else
            {
                format(string,sizeof(string),"Admin %s {3333FF}has make | NEW CHAINSAW ZOMBIE |!{663333} Watch color on map!",PlayerName);
                SendClientMessageToAll(COLOR_LIGHTBLUE,string);
                format(string, sizeof(string), "~w~We have ~b~new~y~[]CHAINSAW ZOMBIE]");
                GameTextForAll( string, 5000, 3 );
                ResetPlayerWeapons(playerid);
                GivePlayerWeapon(gsendid, 9, 999);
                Zombie[ playerid ] = Create3DTextLabel("{33FF66}I'M{FF3300} CHAINSAW {6633FF}ZOMBIE.",-1,30.0,40.0,50.0,40.0,0);
                Attach3DTextLabelToPlayer( Zombie[ playerid ], playerid, 0.0, 0.0, 0.7);
                SetPlayerHealth(gsendid, 999);
                SetPlayerColor(gsendid, 0xFF6600AA);
                SetPlayerSkin(gsendid, 137);
                Delete3DTextLabel( Knife[ playerid ] );
                Delete3DTextLabel( Dildo[ playerid ] );
                Delete3DTextLabel( Shovel[ playerid ] );
                return 1;
            }
        }
    }
    return 0;
}
Then the first dialog responding, but the twice dont :S I cant undersand :S
Reply
#9

firs of all you need to know what sscnf do.
it reads string and replaces it in your defined params, so sscanf2:
pawn Код:
if(dialogid == 9991)
    {
        if(response)
        {
            new gsendid;
            new string[256];
            new PlayerName[MAX_PLAYER_NAME];
            GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
            if (sscanf(inputtext, "u", gsendid))
            if(gsendid == INVALID_PLAYER_ID) return SendClientMessage(playerid, Color_Red, "{9999CC}Player not found!");
            else
            {
                format(string,sizeof(string),"Admin %s {3333FF}has make | NEW CHAINSAW ZOMBIE |!{663333} Watch color on map!",PlayerName);
                SendClientMessageToAll(COLOR_LIGHTBLUE,string);
                format(string, sizeof(string), "~w~We have ~b~new~y~[]CHAINSAW ZOMBIE]");
                GameTextForAll( string, 5000, 3 );
                ResetPlayerWeapons(playerid);
                GivePlayerWeapon(gsendid, 9, 999);
                Zombie[ playerid ] = Create3DTextLabel("{33FF66}I'M{FF3300} CHAINSAW {6633FF}ZOMBIE.",-1,30.0,40.0,50.0,40.0,0);
                Attach3DTextLabelToPlayer( Zombie[ playerid ], playerid, 0.0, 0.0, 0.7);
                SetPlayerHealth(gsendid, 999);
                SetPlayerColor(gsendid, 0xFF6600AA);
                SetPlayerSkin(gsendid, 137);
                Delete3DTextLabel( Knife[ playerid ] );
                Delete3DTextLabel( Dildo[ playerid ] );
                Delete3DTextLabel( Shovel[ playerid ] );
                return 1;
            }
        }
    }
    return 0;
}
I dont want to understand what your function will do but remember to replace playerid to gsendid in arrays/3D label creating etc...

I guess you will need
pawn Код:
Zombie[ gsendid] = Create...
Reply
#10

Quote:
Originally Posted by GaGlets®
Посмотреть сообщение
I guess you will need
pawn Код:
Zombie[ gsendid] = Create...
I know that, i make that, but didint work :S I post there old code :S

BUT, THAT DONT WORK :S

Its real code ...

pawn Код:
if(dialogid == 9991)
    {
        if(response)
        {
            new gsendid;
            new dildo;
            new knife;
            new shovel;
            new string[256];
            new PlayerName[MAX_PLAYER_NAME];
            GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
            if (sscanf(inputtext, "u", gsendid))
            if(gsendid == INVALID_PLAYER_ID) return SendClientMessage(gsendid, Color_Red, "{9999CC}Player not found!");
            else
            {
                format(string,sizeof(string),"Admin %s {3333FF}has make | NEW CHAINSAW ZOMBIE |!{663333} Watch color on map!",PlayerName);
                SendClientMessageToAll(COLOR_LIGHTBLUE,string);
                format(string, sizeof(string), "~w~We have ~b~new~y~[]CHAINSAW ZOMBIE]");
                GameTextForAll( string, 5000, 3 );
                ResetPlayerWeapons(gsendid);
                GivePlayerWeapon(gsendid, 9, 999);
                Zombie[ gsendid ] = Create3DTextLabel("{33FF66}I'M{FF3300} CHAINSAW {6633FF}ZOMBIE.",-1,30.0,40.0,50.0,40.0,0);
                Attach3DTextLabelToPlayer( Zombie[ gsendid ], gsendid, 0.0, 0.0, 0.7);
                SetPlayerHealth(gsendid, 999);
                SetPlayerColor(gsendid, 0xFF6600AA);
                SetPlayerSkin(gsendid, 137);
                Delete3DTextLabel( Knife[ knife ] );
                Delete3DTextLabel( Dildo[ dildo ] );
                Delete3DTextLabel( Shovel[ shovel ] );
                return 1;
            }
        }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)