27.01.2013, 16:24
Problem 1
Alright i have that command for my server what it does is
When a player types /airstrike a timer of 5 seconds will countdown and than explosions around the player.
But the problem now is when i do the command and i manage too kill someone the player who does /airstike won't get any kills the other player will just die cause of the explosions.
I want it when the player does /airstrike and manage to kill someone that he GETS the kill.
Problem 2
I have this command
But it when i do example /giveallweapon 38 200 it automaticly gives all players 0 ammo.
I want too let the admin chose how many ammo he gives.
pawn Код:
COMMAND:airstrike(playerid, params[])
{
if(PInfo[playerid][Level] < 7) return SendClientMessage(playerid,0xFF0000AA,"ERROR: Sorry this command is under construction! Greets Max");
if(PInfo[playerid][Logged] == 0) return SendClientMessage(playerid,0xFF0000AA,"Login to use this command");
if(GetPlayerScore(playerid) < 2000) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough score, you need 2000 score(Rank 7)");
if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough money.");
GivePlayerMoney(playerid,-10000);
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
SendClientMessage(playerid, 0xFF0000FF, "Air Strike Successfully Done!");
SetTimerEx("ExplodeBomb", 5000, false, "ifff", playerid, Pos[0], Pos[1], Pos[2]);
return 1;
}
forward ExplodeBomb(playerid, Float:PosX, Float:PosY, Float:PosZ);
public ExplodeBomb(playerid, Float:PosX, Float:PosY, Float:PosZ)
{
SendClientMessage(playerid, GREEN, "Sir! The bombs have been detonated!");
CreateExplosion(PosX, PosY, PosZ, 7, 20.0);
return 1;
}
When a player types /airstrike a timer of 5 seconds will countdown and than explosions around the player.
But the problem now is when i do the command and i manage too kill someone the player who does /airstike won't get any kills the other player will just die cause of the explosions.
I want it when the player does /airstrike and manage to kill someone that he GETS the kill.
Problem 2
I have this command
pawn Код:
COMMAND:giveallweapon(playerid,params[])
{
if(PInfo[playerid][Level] < 4) return SendClientMessage(playerid,0xFF0000AA,"ERROR: You are not allowed to use this command!");
{
new gun, WeapName[64], ammo, string[128];
if(sscanf(params, "d", gun,ammo))
{
SendClientMessage(playerid,RED,"Usage: /giveallweapon <weapon id> <ammount>");
return 1;
}
new ammount;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
PlayerPlaySound(i,1057,0.0,0.0,0.0);
GivePlayerWeapon(i,gun,ammo);
}
}
new pname[24];
GetWeaponName(gun, WeapName, sizeof(WeapName));
GetPlayerName(playerid,pname,sizeof(pname));
format(string,sizeof(string),"Administrator %s has given all players a %s with %d ammo", pname, WeapName, ammount);
SendClientMessageToAll(blue, string);
//
}
return 1;
}
I want too let the admin chose how many ammo he gives.