12.11.2010, 05:48
(
Последний раз редактировалось 435076378; 12.11.2010 в 06:10.
)
pawn Код:
new i, weaponid, ammo;
new string[212];
new gunname[200];
for (i=0; i<13; i++)
{
GetPlayerWeaponData(playerid,i,weaponid,ammo);
if(weaponid == 0)
{
}
else
{
GetWeaponNameEx(weaponid, gunname, sizeof(gunname));
format(string, sizeof string,"%s%s %d\n",string, gunname,ammo);
? = weaponid; //Here See here
}
}
ShowPlayerDialog(playerid, weap, DIALOG_STYLE_LIST,"My Weapons",string, "ok", "Cancel");
next
How to get target ?
Any access to a target?
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == weap)
{
if(response)
{
if(listitem < 13)
{
ShowPlayerDialog(playerid, weap2, DIALOG_STYLE_LIST,"My Weapons","Throw away\nEquipment", "ok", "Cancel");
}
}
else
{
}
return 1;
}
if(dialogid == weap2)
{
if(response)
{
if(listitem == 0)
{
//new gunID = GetPlayerWeapon(playerid);
//new gunAmmo = GetPlayerAmmo(playerid);
new gunID = ? ; //Here See here
new gunAmmo = ? ;//Here See here
new f = maxobj+1;
for(new a = 0; a < sizeof(ObjCoords); a++)
{
if(ObjCoords[a][0] == 0.0) f = a;
}
RemovePlayerWeapon(playerid, gunID);
ObjectID[f][0] = gunID;
ObjectID[f][1] = gunAmmo;
GetPlayerPos(playerid, ObjCoords[f][0], ObjCoords[f][1], ObjCoords[f][2]);
object[f] = CreateObject(GunObjects[gunID][0],ObjCoords[f][0],ObjCoords[f][1],ObjCoords[f][2]-1,93.7,120.0,120.0);
}
if(listitem == 1)
{
}
}
return 1;
}
Or
new playername[MAX_PLAYER_NAME];
new string[2048];
for(new i;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
GetPlayerName(i, playername, MAX_PLAYER_NAME);
format(string, sizeof string,"%s%d %s\n",string,i,playername);
}
}
ShowPlayerDialog(playerid, LIST, DIALOG_STYLE_LIST,"PlayersLIST",string, "ok", "Cancel");
next
How to get target ?
Any access to a target?
if(dialogid == LIST)
{
if(response)
{
How to get here, how a player should be a goal?
}
else
{
}