if(strcmp(cmd, "/agiveweapon", true) == 0)
{
tmp = strtok(cmdtext, idx);
new tmp2[256];
new tmp3[256];
tmp = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
tmp3 = strtok(cmdtext, idx);
new id;
new gun = strval(tmp2);
new ammo = strval(tmp3);
id = strval(tmp);
gun = strval(tmp2);
ammo = strval(tmp3);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), "level");
PlayerInfo[giveplayerid][pAdmin] = dini_Int(udb_encode(giveplayer), "level");
}
if(logged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be logged in!");
return 1;
}
if(PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "You are not allowed to use that command!");
return 1;
}
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /agiveweapon [id] [arme] [munitions]");
return 1;
}
if(!strlen(tmp2))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /agiveweapon [id] [arme] [munitions]");
return 1;
}
if (IsPlayerConnected(giveplayerid))
{
GivePlayerWeapon(playerid, gun, ammo); // error 035: argument type mismatch (argument 2)
format(string, sizeof(string), "You have given %s a %d with %d ammo.", giveplayer, gun, ammo);
SendClientMessage(playerid, COLOR_ORANGE, string);
}
else {
format(string, sizeof(string), "ID:%d is not an active player.", id);
SendClientMessage(playerid, COLOR_BRIGHTRED, string);
return 1;
}
COMMAND:agiveweapon(playerid, params[])
{
if(!logged[playerid])
return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be logged in!");
if(PlayerInfo[playerid][pAdmin] < 1)
return SendClientMessage(playerid, COLOR_BRIGHTRED, "You are not allowed to use that command!");
new
targetid = INVALID_PLAYER_ID,
weaponid,
ammo;
if(sscanf(params, "uii", targetid, weaponid ammo))
return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /agiveweapon [id] [arme] [munitions]");
if(!IsPlayerConnected(targetid))
{
format(string, sizeof(string), "ID:%d is not an active player.", targetid);
SendClientMessage(playerid, COLOR_BRIGHTRED, string);
return 1;
}
new
targetName[MAX_PLAYER_NAME],
weaponName[32];
GetPlayerName(targetid, targetName, sizeof targetName);
GetWeaponName(weaponid, weaponName, sizeof weaponName);
GivePlayerWeapon(targetid, weaponid, ammo);
format(string, sizeof(string), "You have given %s a %d with %d ammo.", targetName, weaponName, ammo);
SendClientMessage(playerid, COLOR_ORANGE, string);
return 1;
}
if(strcmp(cmd, "/agiveweapon", true) == 0)
{
if(logged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be logged in.");
return 1;
}
if(PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "You are not allowed to use this command!");
return 1;
}
new targetid = giveplayerid;
new weaponid;
new ammo;
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /agiveweapon [id] [arme] [munitions]");
return 1;
}
if (IsPlayerConnected(targetid))
{
new targetName[MAX_PLAYER_NAME];
new weaponName[32];
GetPlayerName(targetid, targetName, sizeof targetName);
GetWeaponName(weaponid, weaponName, sizeof weaponName);
GivePlayerWeapon(targetid, weaponid, ammo);
format(string, sizeof(string), "You have given %s a %s with %d ammo.", targetName, weaponName, ammo);
SendClientMessage(playerid, COLOR_ORANGE, string);
return 1;
}
else
{
format(string, sizeof(string), "ID:%d is not an active player.", targetid);
SendClientMessage(playerid, COLOR_BRIGHTRED, string);
}
return 1;
}
COMMAND:agiveweapon(playerid, params[]) // 4551
{
if(!logged[playerid])
return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be logged in!");
if(PlayerInfo[playerid][pAdmin] < 1)
return SendClientMessage(playerid, COLOR_BRIGHTRED, "You are not allowed to use that command!");
new
targetid = INVALID_PLAYER_ID, // 4560
weaponid,
ammo;
if(sscanf(params, "uii", targetid, weaponid ammo)) // 4564
return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /agiveweapon [id] [arme] [munitions]");
if(!IsPlayerConnected(targetid))
{
format(string, sizeof(string), "ID:%d is not an active player.", targetid);
SendClientMessage(playerid, COLOR_BRIGHTRED, string);
return 1;
}
new
targetName[MAX_PLAYER_NAME],
weaponName[32];
GetPlayerName(targetid, targetName, sizeof targetName);
GetWeaponName(weaponid, weaponName, sizeof weaponName);
GivePlayerWeapon(targetid, weaponid, ammo);
format(string, sizeof(string), "You have given %s a %d with %d ammo.", targetName, weaponName, ammo);
SendClientMessage(playerid, COLOR_ORANGE, string);
return 1;
}
\pawno\include\sscanf2.inc(27) : error 021: symbol already defined: "sscanf"
\pawno\include\sscanf2.inc(28) : error 021: symbol already defined: "unformat"
(4551) : error 017: undefined symbol "agiveweapon"
(4560) : warning 219: local variable "targetid" shadows a variable at a preceding level
(4564) : error 017: undefined symbol "params"
(4564) : warning 215: expression has no effect
(4564) : error 001: expected token: ";", but found ")"
(4564) : error 029: invalid expression, assumed zero
(4564) : fatal error 107: too many error messages on one line
//===============================Include Files==================================
#include <a_samp>
#include <dini>
#include <dudb>
#include <time>
#include <file>
#include <dutils>
#include <float>
#include <dcmd>
native sscanf(const data[], const format[], {Float,_}:...);
native unformat(const data[], const format[], {Float,_}:...) = sscanf;
#include <sscanf2> #include <zcmd> |