/slap - Dialog response - Is this possible?
#1

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)