18.02.2011, 22:26
guyz i have a dialog for admin cmds and here it is :
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 !!!
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;
}
help plz and soooo much appreciating and respect and thanks for the one who will fix them
thanks for reading
cya !!!