17.11.2011, 15:02
Pega isso e modifique:
pawn Код:
if(strcmp(cmd, "/dararma", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "[AV] /weaponequip [Player ID / Player Name] [Weapon ID] [quantia]");
return 1;
}
new playa;
new gun;
new ammo;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
gun = strval(tmp);
new nomegay[MAX_PLAYER_NAME];
GetPlayerName(playa, nomegay, sizeof(nomegay));
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "[AV] /weaponequip [IdPLayer/ParteDoNome] [weaponid] [quantia]");
SendClientMessage(playerid, COLOR_GRAD4, "1(Brass) 2(Nite) 3(Club) 4(knife) 5(bat) 6(Shovel) 7(Cue) 8(Katana) 9(Chainsaw) 10-13(Dildo)");
SendClientMessage(playerid, COLOR_GRAD4, "14(Flowers) 15(Cane) 16(Grenades) 17(Teargas) 18(Molotovs) 22(Pistol) 23(SPistol) 24(Eagle)");
SendClientMessage(playerid, COLOR_GRAD4, "25(Shotgun) 26(sawn-off) 27(Combat) 28(TEC9) 29(MP5) 30(AK47) 31(M4) 32(MAC10) 33(Country)");
SendClientMessage(playerid, COLOR_GRAD3, "34(Sniper) 35(RPG) 37(Flamethrower) 38(Minigun) 41(spray) 42(exting) 43(Camera) 46(Parachute)");
return 1;
}
if(gun < 1||gun > 46||gun==19||gun==20||gun==21||gun==44||gun==45)
{ SendClientMessage(playerid, COLOR_GRAD1, "[AV] Invalid WeaponID!"); return 1; }
tmp = strtok(cmdtext, idx);
ammo = strval(tmp);
if(ammo > 49999)
{ SendClientMessage(playerid, COLOR_GRAD1, "[AV] Dont go below 1 or above 49999 bullets!"); return 1; }
if (PlayerInfo[playerid][pAdmin] >= 1338 || IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
format(string, 128, "[AV] %s deu uma arma para %s(%d) [ArmaID %d].", sendername,nomegay,giveplayerid,gun);
BroadCast(COLOR_RED,string);
SafeGivePlayerWeapon(playa, gun, ammo);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s deu para %s arma ID %d com %d balas.",d,m,y,h,mi,s,sendername,nomegay,gun,ammo);
GiveLog(string);
AdminLog(string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "[AV] vocк nгo estб autorizado a usar esse comando!");
}
}
return 1;
}