08.06.2010, 22:41
pawn Код:
dcmd_dararma(playerid,params[]) {
if(PlayerInfo[playerid][Nivel] == 1)
{
new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index), tmp3 = strtok(params,Index);
if(!strlen(tmp) || !strlen(tmp2)) return SendClientMessage(playerid, Rojo, "[[Uso:]] /dararma [ID] [arma] [Municion]");
new player1 = strval(tmp), weap, ammo, WeapName[32], string[128];
if(!strlen(tmp3) || !IsNumeric(tmp3) || strval(tmp3) <= 0 || strval(tmp3) > 99999) ammo = 500; else ammo = strval(tmp3);
if(!IsNumeric(tmp2)) weap = GetWeaponIDFromName(tmp2); else weap = strval(tmp2);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
if(!IsValidWeapon(weap)) return SendClientMessage(playerid,Rojo,"[[InfO:]] ID de Arma incorrecto");
GetWeaponName(weap,WeapName,32);
format(string, sizeof(string), "Has dado a %s un Arma (%d)", PlayerName2(player1), WeapName, weap); SendClientMessage(playerid,Aviso,string);
if(player1 != playerid) { format(string,sizeof(string),"[Admin] %s A dado a %s Arma:[%d]", PlayerName2(playerid), WeapName, weap); SendClientMessage(player1,Aviso,string); }
return GivePlayerWeapon(player1, weap, ammo);
} else return SendClientMessage(playerid, Rojo, "*[[Info]] Jugador no Conectado");
} else return SendClientMessage(playerid, Rojo,"[[InfO:]] Lo Sentimos no eres Admin de Nivel suficiente");
}
Код:
[[InfO:]] Lo Sentimos no eres Admin de Nivel suficiente