NEED SOO MUCH HELP
#1

guyz i have a dialog for admin cmds and here it is :
pawn Код:
if(dialogid == 7)
    {
    if(response == 0) return SendClientMessage(playerid, 0xff0000ff, "You closed the Admin cmds Dialog");
    switch(listitem)
    {
    case 0:{
    SendClientMessage(playerid, 0xff0000ff, "This CMD is not completed yet");
    }
    case 1:{
    new playerid2,PlayerName[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
    new tmp[256], str[49];
    playerid2 = strval(tmp);
    GetPlayerName(playerid2,on,sizeof(on));
    GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
    if(!IsPlayerConnected(playerid2))return SendClientMessage(playerid,0xff0000ff,"Player is not connected!");
    format(str,sizeof(str),"Admin %s has kicked %s",PlayerName,on);
    SendClientMessageToAll(0xff0000ff,str);
    Kick(playerid2);
    }
    case 2:{
    new playerid2,PlayerName[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
    new tmp[256], str[49];
    playerid2 = strval(tmp);
    GetPlayerName(playerid2,on,sizeof(on));
    GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
    if(!IsPlayerConnected(playerid2))return SendClientMessage(playerid,0xff0000ff,"Player is not connected!");
    format(str,sizeof(str),"Admin %s has Banned %s",PlayerName,on);
    SendClientMessageToAll(0xff0000ff,str);
    Ban(playerid2);
    }
    case 3:{
    new tmp[256];
    new string[256];
    new otherplayer = strval(tmp);
    new pName[MAX_PLAYER_NAME];
    format(string, sizeof(string), "You Killed %s Succefully", pName);
    SendClientMessage(playerid, 0xff0000ff, string);
    SetPlayerHealth(otherplayer, 0);
    SendClientMessage(otherplayer, 0x00FF00FF, "An Admin Has Killed You");
    }
    case 4:{
    new id;
    new tmp[256];
    new string[256];
    new giveplayer[MAX_PLAYER_NAME];
    id = strval(tmp);
    new Float:X;
    new Float:Y;
    new Float:Z;
    GetPlayerPos(id,X,Y,Z);
    if(IsPlayerInAnyVehicle(playerid))
    {
    GetPlayerName(id, giveplayer, sizeof(id));
    SetVehiclePos(GetPlayerVehicleID(playerid),X+2,Y+1,Z);
    format(string, sizeof(string), "You have teleported to %s", id);
    SendClientMessage(playerid,COLOR_WHITE, string);
    }
    else
    {
    SetPlayerPos(playerid, X+1, Y+1, Z);
    }
    }
    }
    }
    return 1;
    }
so as u see its cool and working but its working for id 0, its just working for id1 and etc no for id 0, when id 0 kick it kicks him and when id 1 kick, kick choosen player so why the problem in id 0
help plz and soooo much appreciating and respect and thanks for the one who will fix them
thanks for reading
cya !!!
Reply
#2

How do you have this working? How are you showing the dialog?
Reply
#3

easy, but this is my problem i can't put case 5:{
Reply
#4

Try it now
pawn Код:
if(dialogid == 7)
{
    if(!response) { SendClientMessage(playerid,0xff0000ff, "You closed the Admin cmds Dialog"); return 1; }
    new playerid2,PlayerName[24],on[24],string[128];
    switch(listitem)
    {
        playerid2 = strval(intputtext);
        if(!IsPlayerConnected(playerid2))
        {
            SendClientMessage(playerid,0xff0000ff,"Player is not connected!"); return 1;
        }
        GetPlayerName(playerid2,on,sizeof(on));
        GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
        case 0:
        {
            SendClientMessage(playerid, 0xff0000ff, "This CMD is not completed yet");
        }
        case 1:
        {
            format(string,sizeof(string),"Admin %s has kicked %s",PlayerName,on);
            SendClientMessageToAll(0xff0000ff,string);
            Kick(playerid2);
        }
        case 2:
        {
            format(string,sizeof(string),"Admin %s has Banned %s",PlayerName,on);
            SendClientMessageToAll(0xff0000ff,string);
            Ban(playerid2);
        }
        case 3:
        {
            format(string, sizeof(string), "You Killed %s Succefully",on);
            SendClientMessage(playerid, 0xff0000ff, string);
            SetPlayerHealth(otherplayer, 0);
            SendClientMessage(otherplayer, 0x00FF00FF, "An Admin Has Killed You");
        }
        case 4:
        {
            new Float:X;
            new Float:Y;
            new Float:Z;
            GetPlayerPos(playerid2,X,Y,Z);
            if(IsPlayerInAnyVehicle(playerid2))
            {
                SetVehiclePos(GetPlayerVehicleID(playerid),X+2,Y+1,Z);
                format(string, sizeof(string), "You have teleported to %s",on);
                SendClientMessage(playerid,COLOR_WHITE, string);
            }
            else
            {
                SetPlayerPos(playerid, X+1, Y+1, Z);
            }
        }
    }
    return 1;
}
Dont just copy and paste it, check if its fits to your thing what you want that this script do, I just made it so script works
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)