23.08.2011, 20:15
lol fails:
y did you put things that need to be under OnPlayerConnect,under OnFilterScriptInIt?
y do you leave so much useless callbacks
wtf?
y you didnt do:
y did you put things that need to be under OnPlayerConnect,under OnFilterScriptInIt?
y do you leave so much useless callbacks
wtf?
pawn Code:
C(giveweapon)
{
new wepname[128], giveid;
if(PData[playerid][Level] < 4) return SCM(playerid, red, "ERROR: You don't have access to this command.");
else if(sscanf(params, "rs[128]", giveid, wepname)) return SCM(playerid, yellow, "SYNTAX: /giveweapon <name/id> <weapon>");
else if(giveid == INVALID_PLAYER_ID) return SCM(playerid, yellow, "ERROR: That player isn't online!");
else
{
if(!strcmp(wepname, "golf", true)) GivePlayerWeapon(giveid, 2, 1);
else if(!strcmp(wepname, "knife", true)) GivePlayerWeapon(giveid, 4, 1);
else if(!strcmp(wepname, "bat", true)) GivePlayerWeapon(giveid, 5, 1);
else if(!strcmp(wepname, "shovel", true)) GivePlayerWeapon(giveid, 6, 1);
else if(!strcmp(wepname, "dildo", true)) GivePlayerWeapon(giveid, 10, 1);
else if(!strcmp(wepname, "katana", true)) GivePlayerWeapon(giveid, 8, 1);
else if(!strcmp(wepname, "chainsaw", true)) GivePlayerWeapon(giveid, 9, 1);
else if(!strcmp(wepname, "flowers", true)) GivePlayerWeapon(giveid, 14, 1);
else if(!strcmp(wepname, "cane", true)) GivePlayerWeapon(giveid, 14, 1);
else if(!strcmp(wepname, "grenade", true)) GivePlayerWeapon(giveid, 16, 500);
else if(!strcmp(wepname, "teargas", true)) GivePlayerWeapon(giveid, 17, 500);
else if(!strcmp(wepname, "molotov", true)) GivePlayerWeapon(giveid, 18, 500);
else if(!strcmp(wepname, "pistol", true)) GivePlayerWeapon(giveid, 22, 500);
else if(!strcmp(wepname, "silenced", true)) GivePlayerWeapon(giveid, 23, 500);
else if(!strcmp(wepname, "deagle", true)) GivePlayerWeapon(giveid, 24, 500);
else if(!strcmp(wepname, "shotgun", true)) GivePlayerWeapon(giveid, 25, 500);
else if(!strcmp(wepname, "sawnoff", true)) GivePlayerWeapon(giveid, 26, 500);
else if(!strcmp(wepname, "spas", true)) GivePlayerWeapon(giveid, 27, 500);
else if(!strcmp(wepname, "smg", true)) GivePlayerWeapon(giveid, 28, 500);
else if(!strcmp(wepname, "mp5", true)) GivePlayerWeapon(giveid, 29, 500);
else if(!strcmp(wepname, "ak47", true)) GivePlayerWeapon(giveid, 30, 500);
else if(!strcmp(wepname, "m4", true)) GivePlayerWeapon(giveid, 31, 500);
else if(!strcmp(wepname, "tec9", true)) GivePlayerWeapon(giveid, 32, 500);
else if(!strcmp(wepname, "sniper", true)) GivePlayerWeapon(giveid, 34, 500);
else if(!strcmp(wepname, "rpg", true)) GivePlayerWeapon(giveid, 35, 500);
else if(!strcmp(wepname, "hsrpg", true)) GivePlayerWeapon(giveid, 36, 500);
else if(!strcmp(wepname, "flamethrower", true)) GivePlayerWeapon(giveid, 37, 500);
else if(!strcmp(wepname, "minigun", true)) GivePlayerWeapon(giveid, 38, 500);
else if(!strcmp(wepname, "satchel", true)) GivePlayerWeapon(giveid, 39, 500);
else if(!strcmp(wepname, "detonator", true)) GivePlayerWeapon(giveid, 40, 1);
else if(!strcmp(wepname, "spraycan", true)) GivePlayerWeapon(giveid, 41, 500);
else if(!strcmp(wepname, "fireextinguisher", true)) GivePlayerWeapon(giveid, 42, 500);
else if(!strcmp(wepname, "parachute", true)) GivePlayerWeapon(giveid, 46, 1);
else SCM(playerid, red, "ERROR: Invalid weapon.");
}
return 1;
}
pawn Code:
CMD:giveweapon(playerid, params[])
{
new
wepname[128],
giveid;
sscanf(params, "ri",giveid, weaponid)) {
GivePlayerWeapon(giveid, weaponid);
}else{
SendClientMessage(playerid, COLOR_BLUE, "USAGE: /giveweapon [playerid] [weaponid]");
}
return 1;
}