SA-MP Forums Archive
/slap - Dialog response - Is this possible? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /slap - Dialog response - Is this possible? (/showthread.php?tid=190205)



/slap - Dialog response - Is this possible? - spyr0x - 14.11.2010

I still have no testers to see if my commands are working as it should, so i'm wondering if this is possible:

pawn Код:
if(dialogid == 010)
    {
        if(!response) {
        victim[playerid] = -1;
        nextdialog[playerid] = 0;
        }
        else {
        new string[256];
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pname, sizeof(pname));
        new pname2[MAX_PLAYER_NAME];
        if(nextdialog[playerid] == 0) {
        victim[playerid] = strval(inputtext);
        if(!IsPlayerConnected(victim[playerid])) {
        format(string,sizeof(string),"[PN-Admin] Could not find any player with id %d.",victim[playerid]);
        SendClientMessage(playerid, orange, string);
        victim[playerid] = -1;
        }
        else {
        GetPlayerName(victim[playerid], pname2, sizeof(pname2));
        format(string,sizeof(string),"[PN-Admin] You are about to slap %s(%d).",pname2, victim[playerid]);
        SendClientMessage(playerid, yellow, string);
        nextdialog[playerid] = 1; ShowPlayerDialog(playerid, 010, DIALOG_STYLE_INPUT, "Slap", "Please enter the height to drop player", "Slap", "Cancel");
        }
        }
        else if(nextdialog[playerid] == 1) {
        new
        Float:x,
        Float:y,
        Float:z;
        GetPlayerPos(victim[playerid], x, y, z);
        SetPlayerPos(victim[playerid],x,y,z+strval(inputtext)); PlayerPlaySound(victim[playerid],1190,0.0,0.0,0.0);
        GetPlayerName(victim[playerid], pname2, sizeof(pname2));
        format(string,sizeof(string),"[PN-Admin] %s slapped player %s.",pname, pname2);
        SendClientMessageToAll(red, string);
        victim[playerid] = -1;
        nextdialog[playerid] = 0;
        }
        }
        }
    return 1;
}