29.09.2013, 17:33
OOMMGGG! THANKS!!@!! And lastly this one is really complicated but I hope you can help me with this. Also make this to dialog. Anyway I gave you +rep
Код:
CMD:getinfo(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: /getinfo <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);
}



