stock SendMessageToAdmins(string)
{
for(new i = 0; i != MAX_PLAYERS; i++)
{
if(PVar[i][alevel] > 0)
{
SendClientMessage(i, 0xCC000000, string);
}
}
return 1;
}
command(giveweapon, playerid, params[])
{
if(loggedin[playerid] == 0) return SendClientMessage(playerid, 0x66666666, "You must be logged in perform commands");
if(PVar[playerid][alevel] >2)
{
new str[128], sWeapon;
new id, ammo;
if(sscanf(params, "uk<weapons>d", id, sWeapon, ammo)) return SendClientMessage(playerid, 0x66666666, "Usage: /giveweapon [Player ID] [Weapon ID] [Ammo] * You can only give 5000 ammo with the weapon *");
{
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0x66666666, "That player is not connected.");
if(sWeapon == -1) return SendClientMessage(playerid, 0x66666666, "That weapon model or ID doesn't exist.");
if(ammo > 5000 || ammo < 0) return SendClientMessage(playerid, 0x66666666, "You can only give between 1-5000 ammo.");
if(playerid == id)
{
format(str, sizeof(str), "You have given yourself a %s [ID %d] with '%d' ammo.", WeaponNames[sWeapon], sWeapon, ammo);
SendClientMessage(id, 0x66999999, str);
GivePlayerWeapon(id, sWeapon, ammo);
}
else
{
format(str, sizeof(str), "You have given %s a '%s [ID %d]' with '%d' ammo.", RemoveUnderScore(id), WeaponNames[sWeapon], sWeapon, ammo);
SendClientMessage(playerid, 0x66999999, str);
format(str, sizeof(str), "You have been given a '%s [ID %d]' with '%d' ammo by %s.", WeaponNames[sWeapon], sWeapon, ammo, RemoveUnderScore(playerid));
SendClientMessage(id, 0x66999999, str);
format(str, sizeof(str), "%s has given %s a '%s (ID %d)' with '%d' ammo.", RemoveUnderScore(playerid), RemoveUnderScore(id), WeaponNames[sWeapon], sWeapon, ammo);
SendMessageToAdmins(str)
GivePlayerWeapon(id, sWeapon, ammo);
}
}
}
else
{
SendClientMessage(playerid, 0x66666666, "You are not authorised to use that command.");
return 1;
}
return 1;
}
C:\Users\Ben\Desktop\SF-RP\gamemodes\bensamp.pwn(1898) : error 035: argument type mismatch (argument 1)
C:\Users\Ben\Desktop\SF-RP\gamemodes\bensamp.pwn(2459) : error 035: argument type mismatch (argument 3)
C:\Users\Ben\Desktop\SF-RP\gamemodes\bensamp.pwn(2453) : warning 203: symbol is never used: "string"
command(giveweapon, playerid, params[])
{
if(loggedin[playerid] == 0) return SendClientMessage(playerid, 0x66666666, "You must be logged in perform commands");
if(PVar[playerid][alevel] >2)
{
new sWeapon;
new id, ammo;
if(sscanf(params, "uk<weapons>d", id, sWeapon, ammo)) return SendClientMessage(playerid, 0x66666666, "Usage: /giveweapon [Player ID] [Weapon ID] [Ammo] * You can only give 5000 ammo with the weapon *");
{
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0x66666666, "That player is not connected.");
if(sWeapon == -1) return SendClientMessage(playerid, 0x66666666, "That weapon model or ID doesn't exist.");
if(ammo > 5000 || ammo < 0) return SendClientMessage(playerid, 0x66666666, "You can only give between 1-5000 ammo.");
if(playerid == id)
{
format(string, sizeof(string), "You have given yourself a %s [ID %d] with '%d' ammo.", WeaponNames[sWeapon], sWeapon, ammo);
SendClientMessage(id, 0x66999999, string);
GivePlayerWeapon(id, sWeapon, ammo);
}
else
{
format(string, sizeof(string), "You have given %s a '%s [ID %d]' with '%d' ammo.", RemoveUnderScore(id), WeaponNames[sWeapon], sWeapon, ammo);
SendClientMessage(playerid, 0x66999999, string);
format(string, sizeof(string), "You have been given a '%s [ID %d]' with '%d' ammo by %s.", WeaponNames[sWeapon], sWeapon, ammo, RemoveUnderScore(playerid));
SendClientMessage(id, 0x66999999, string);
format(string, sizeof(string), "%s has given %s a '%s (ID %d)' with '%d' ammo.", RemoveUnderScore(playerid), RemoveUnderScore(id), WeaponNames[sWeapon], sWeapon, ammo);
SendMessageToAdmins(-1,string);
GivePlayerWeapon(id, sWeapon, ammo);
}
}
}
else
{
SendClientMessage(playerid, 0x66666666, "You are not authorised to use that command.");
return 1;
}
return 1;
}
SendMessageToAdmins(-1,string);
SendMessageToAdmins(string)
You added:
pawn Code:
pawn Code:
|
C:\Users\Ben\Desktop\SF-RP\gamemodes\bensamp.pwn(1898) : error 035: argument type mismatch (argument 1)
SendMessageToAdmins(str);
C:\Users\Ben\Desktop\SF-RP\gamemodes\bensamp.pwn(2459) : error 035: argument type mismatch (argument 3)
SendClientMessage(i, 0xCC000000, str);
C:\Users\Ben\Desktop\SF-RP\gamemodes\bensamp.pwn(2453) : warning 203: symbol is never used: "str"
stock SendMessageToAdmins(str)
Strings are like this: new string[128];
I guess that those are errors 1 and 2 For the third: stock SendMessageToAdmins(str[] ) |