make this to dialog message box -
kbalor - 28.09.2013
Hi anyone can please help me to make this dialog? Also add getplayerinterior and getplayervirtualworld
Код:
CMD:info(playerid,params[])
{
new id, WeapName[32], slot, weap, ammo, model , Float:Health , Float:Armour,Float:Vheath,Count = 0;
if(sscanf(params, "u",id)) return SendClientMessage(playerid, yellow, "Usage: /Info <Part of Nick/Player ID>");
if(IsPlayerConnected(id))
{
GetPlayerArmour(id,Armour);
GetPlayerHealth(id,Health);
CommandToAdmins(playerid,"info");
format(Jstring, sizeof(Jstring), "__Informations for: %s(%d)__",GetName(id) ,id);
SendClientMessage(playerid, green, Jstring);
if(IsPlayerInAnyVehicle(id))
{
GetVehicleHealth(GetPlayerVehicleID(id), Vheath);
model = GetVehicleModel(GetPlayerVehicleID(id));
format(Jstring, sizeof(Jstring), "Health: %0.1f | Armour: %0.1f | Ratio: %0.2f | Ping: %d | Current vehicle: %s(Model: %d) | Vehicle health: %0.1f", Health , Armour, Float:pInfo[id][Kills]/Float:pInfo[id][Deaths],GetPlayerPing(id),VehicleNames[model-400],model,Vheath);
}
else
format(Jstring, sizeof(Jstring), "Health: %0.1f | Armour: %0.1f | Kills: %d | Deaths: %d |Ratio: %0.2f | Ping: %d", Health , Armour, pInfo[id][Kills],pInfo[id][Deaths], Float:pInfo[id][Kills]/Float:pInfo[id][Deaths],GetPlayerPing(id));
SendClientMessage(playerid, orange, Jstring);
for(slot = 0; slot < 13; slot++)
{
GetPlayerWeaponData(id, slot, weap, ammo);
if( ammo != 0 && weap != 0)
Count++;
}
if(Count == 0)
{
format(Jstring, sizeof(Jstring), "%s has no weapons!",GetName(id));
return SendClientMessage(playerid,green,Jstring);
}
else
{
format(Jstring, sizeof(Jstring), "__%s's weapons__",GetName(id));
SendClientMessage(playerid,red,Jstring);
}
if(Count >= 1)
{
for (slot = 0; slot < 13; slot++)
{
GetPlayerWeaponData(id, slot, weap, ammo);
if( ammo != 0 && weap != 0)
{
GetWeaponName(weap, WeapName, sizeof(WeapName));
format(Jstring,sizeof(Jstring),"%s (%d)", WeapName, ammo);
SendClientMessage(playerid, orange, Jstring);
}
}
}
return 1;
}
else return ShowMessage(playerid, red, 2);
}
Also this one
Код:
CMD:getip(playerid,params[])
{
if(pInfo[playerid][pLevel] >= 2)
{
new id,ip[16];
if(sscanf(params, "u", id)) return SendClientMessage(playerid, yellow, "Usage: /getip <Player ID/Part of Nick>");
if(IsPlayerConnected(id))
{
CommandToAdmins(playerid,"getip");
GetPlayerIp(id,ip,16);
format(Jstring,sizeof(Jstring),"Player Name: %s(ID: %d) | IP: %s", GetName(id),id, ip);
SendClientMessage(playerid,green,Jstring);
return 1;
}
else return ShowMessage(playerid, red, 2);
}
else return ShowMessage(playerid, red, 1);
}
THANK YOU!
Re: make this to dialog message box -
kbalor - 28.09.2013
Hi anyone know how to change this to dialog? so it will be professional look.
Re: make this to dialog message box -
Airin - 28.09.2013
Hello. Well Im not that good of a scripter but I'll see what I can do to help you out since my script has some dialog boxes. First off you need this line somewhere in your script: forward DisplayDialogForPlayer(playerid, dialogid);
Next u need this: ShowPlayerDialog(playerid, astats, DIALOG_STYLE_MSGBOX, title, text, "Done", "Back"); Something like that above is how you would create a dialog box.
Also: ShowPlayerDialog(playerid, vipsounds1, DIALOG_STYLE_LIST, title, szMessageString, "Select", "Close");
And: ShowPlayerDialog(playerid, radio1, DIALOG_STYLE_LIST, title, szMessageString, "Select", "Close");
Also: new dialog[500], title[64], line1[64], line2[64], line3[64], line4[64], line5[64], line6[64], line7[64]; format(title,sizeof(title),"{FF9900}Account Settings");
I hope that gives you some examples. And I hope I was helpful.

If I was please be sure to give me rep. I need it bad!

Anyways, let me know how it goes!