19.03.2011, 18:57
Hello i need some help in two commands
I want to make the command /giveweapon checks the weapon id and tells the admin if it exist or not..
Here's the code
also , my /asay cmd isn't working , but no errors and no warnings , so when i type for example /asay Hey , it shows /asay [text]
Here's the code :
That's all
I want to make the command /giveweapon checks the weapon id and tells the admin if it exist or not..
Here's the code
PHP код:
if(!strcmp(cmd, "/giveweapon"))
{
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFFF,"You are not an admin !");
new targetid, weapon, ammo;
if(sscanf(params, "ud", targetid, weapon,ammo)) return SendClientMessage(playerid, COLOR_RED, "Usage: /giveweapon [playerid/partofname] [weaponid] [ammo]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFFF, "Player not connected!");
//i want to add what i asked here.
else
{
SendClientMessage(targetid, 0xA10000AA,"an Admin has gave a Weapon");
GivePlayerWeapon(targetid,weapon,ammo);
}
}
return 1;
}
Here's the code :
PHP код:
if(!strcmp(cmd, "/asay"))
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFFF,"You are not an admin !");
new text[128];
if(sscanf(params, "s[128]",text)) return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /asay [text]");
new string[128];
new pName[128];
GetPlayerName(playerid,pName,128);
format(string,sizeof string,"[ADMIN]%s: %s",pName,text);
SendClientMessageToAll(0xA10000AA,string);
return 1;
}