PDA

View Full Version : pname not showing..


_Khaled_
25/08/2012, 07:38 AM
Check
dcmd_agivecash(playerid,params[])
{
#pragma unused params
new pname[MAX_PLAYER_NAME];
new id;
new Cash;
new string[128];
if(sscanf(params,"ui",id,Cash))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /agivecash (Player Name/ID) (Amount)");
return 1;
}
GivePlayerMoney(id,Cash);
format(string,sizeof(string),"***An Administrator has given you: %d $.",Cash);
SendClientMessage(id,COLOR_PINK,string);

format(string,sizeof(string),"You have given %s(%d): %d $.",pname,id,Cash);
SendClientMessage(playerid,COLOR_PINK,string);

/*format(string,sizeof(string),"Administrator %s(%d) has given %s(%d): %d $.",PlayerName(playerid),playerid,PlayerName(ID),ID,C ash);
IRC_GroupSay(gGroupAdminID,IRC_ADMINCHANNEL,string );*/
return 1;
}
//------------------------------------------------------------------------------
dcmd_agiveweapon(playerid,params[])
{
#pragma unused params
new pname[MAX_PLAYER_NAME];
new string[128];
new id;
new Ammo;
new Wepid;
if(sscanf(params,"uii",id,Wepid,Ammo))
{
SendClientMessage(playerid,COLOR_ERROR,"Usage: /adgiveweapon (Player Name/ID) (Weapon ID) (Ammo)");
return 1;
}
GivePlayerWeapon(id,Wepid,Ammo);
format(string,sizeof(string),"***An Administrator has given you a weapon. (Weapon: %s.) (Ammo: %d.)",aWeaponNames[Wepid],Ammo);
SendClientMessage(id,COLOR_PINK,string);

format(string,sizeof(string),"***You have given %s(%d) a weapon. (Weapon: %s.) (Ammo: %d.)",pname,id,aWeaponNames[Wepid],Ammo);
SendClientMessage(playerid,COLOR_PINK,string);

/*format(string,sizeof(string),"9[ADMIN WEAPON] Administrator %s(%d) has given %s(%d) a weapon. Weapon: %s. Ammo: %d.",PlayerName(playerid),playerid,PlayerName(ID),ID,a WeaponNames[Wepid],Ammo);
IRC_GroupSay(gGroupAdminID,IRC_ADMINCHANNEL,string );*/
return 1;
}

In game
You have given(0) a weapon. (Weapon: Colt 45.) (Ammo:500.)
same to givecash..

[MM]RoXoR[FS]
25/08/2012, 07:45 AM
GetPlayerName(id,pname,MAX_PLAYER_NAME);
format(string,sizeof(string),"***You have given %s(%d) a weapon. (Weapon: %s.) (Ammo: %d.)",pname,id,aWeaponNames[Wepid],Ammo);

_Khaled_
25/08/2012, 08:15 AM
ThankYou.