18.08.2011, 18:53
anyone have a script for /giveweapond and Death List
if(strcmp(cmd, "/giveweapon", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /givegun [playerid/PartOfName] [weaponid(eg. 46 = Parachute)] [ammo]");
return 1;
}
new playa;
new gun;
new ammo;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
gun = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /givegun [playerid/PartOfName] [weaponid] [ammo]");
SendClientMessage(playerid, COLOR_GRAD4, "3(Club) 4(knife) 5(bat) 6(Shovel) 7(Cue) 8(Katana) 10-13(Dildo) 14(Flowers) 16(Grenades) 18(Molotovs) 22(Pistol) 23(SPistol)");
SendClientMessage(playerid, COLOR_GRAD3, "24(Eagle) 25(shotgun) 29(MP5) 30(AK47) 31(M4) 33(Rifle) 34(Sniper) 37(Flamethrower) 41(spray) 42(exting) 43(Camera) 46(Parachute)");
return 1;
}
tmp = strtok(cmdtext, idx);
ammo = strval(tmp);
if(ammo <1||ammo > 9999)
{ SendClientMessage(playerid, COLOR_GRAD1, " dont go below 1 or above 9999 bullets!"); return 1; }
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GivePlayerWeaponEx(playa, gun, ammo);
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playerid][pAdmin] == 11) { sendername = "Hidden Admin"; }
format(string, 256, "AdmWarning: %s has given %s gun id %d.", sendername,giveplayer,gun);
ABroadCast(COLOR_YELLOW,string,1);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}
Wrong section..
And try this pawn Код:
|
YCMD:giveweapon(playerid, params[], help)
{
#pragma unused help
if(IsPlayerAdmin(playerid))
{
new id,weap,ammo,str[128],Sender[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], Str[128], WeapName[32];
if(sscanf(params,"uii",id,weap,ammo)) return SendClientMessage(playerid,-1,"USAGE: /giveweapon [id] [weapon] [ammo]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Player is not connected!");
GetPlayerName(playerid,name,sizeof(name));
GetPlayerName(id, Sender, sizeof(Sender));
GetWeaponName(weap,WeapName,32);
format(str,sizeof(str),"%s has given you a %s (%d) with %d Ammo.",name,WeapName,weap,ammo);
SendClientMessage(id,-1,str);
GivePlayerWeapon(id,weap,ammo);
else return 0;
return 1;
}
return 1;
}
Why do you keep stripping these useless codes from the godfather!
PHP код:
|
Do you wanna see where the hell am gettin it from god damn ?
|
Let me put it to you straight.
Your acting like a 12 year old. You try to help people, but realistically both I and other members of the forum can see that isn't your own code. Firstly, who even say's that he has those variables defined within his script. Secondly who's still using strcmp to call commands? Anyone using strcmp is most likely using Godfather or an older script. You attempt to give a solution to the simplest problems and yet fail. I'm not starting a war with you, nor I am I flaming at you. I am pointing out your faults, because you seem to be extremely conceited if you think you wrote that code. Have a nice day. |
CMD:giveweapon(playerid, params[])
{
#pragma unused help
if(IsPlayerAdmin(playerid))
{
new id,weap,ammo,str[128],Sender[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], Str[128], WeapName[32];
if(sscanf(params,"uii",id,weap,ammo)) return SendClientMessage(playerid,-1,"USAGE: /giveweapon [id] [weapon] [ammo]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Player is not connected!");
GetPlayerName(playerid,name,sizeof(name));
GetPlayerName(id, Sender, sizeof(Sender));
GetWeaponName(weap,WeapName,32);
format(str,sizeof(str),"%s has given you a %s (%d) with %d Ammo.",name,WeapName,weap,ammo);
SendClientMessage(id,-1,str);
GivePlayerWeapon(id,weap,ammo);
else return 0;
return 1;
}
return 1;
}
Paste this code onto the bottom of your script.
pawn Код:
|
CMD:giveweapon(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new id,weap,ammo,str[128],Sender[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], Str[128], WeapName[32];
if(sscanf(params,"uii",id,weap,ammo)) return SendClientMessage(playerid,-1,"USAGE: /giveweapon [id] [weapon] [ammo]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Player is not connected!");
GetPlayerName(playerid,name,sizeof(name));
GetPlayerName(id, Sender, sizeof(Sender));
GetWeaponName(weap,WeapName,32);
format(str,sizeof(str),"%s has given you a %s (%d) with %d Ammo.",name,WeapName,weap,ammo);
SendClientMessage(id,-1,str);
GivePlayerWeapon(id,weap,ammo);
else return 0;
return 1;
}
return 1;
}
ZCMD doesn't support the help parameter. This is a useful function which allows easy recognition of a command's description in y_commands.
PHP код:
|