17.07.2014, 07:48
Somehow I just can't finish kinda all of my cmds, I always have something wrong or anything else.
Anyways For the people who are tired of my threads, don't reply then. for the people who wants to help me (appreciated)
I just don't know what I need to add to give the player a weapon.
when I do /giveweapon 1 24 500, it says to the player "You received a weapon" while he doesn't got that weapon.
I know its something with (strcmp but I'm not sure.
Anyways For the people who are tired of my threads, don't reply then. for the people who wants to help me (appreciated)
I just don't know what I need to add to give the player a weapon.
when I do /giveweapon 1 24 500, it says to the player "You received a weapon" while he doesn't got that weapon.
I know its something with (strcmp but I'm not sure.
PHP код:
CMD:giveweapon(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "SERVER: Unknown command.");
new id, target, weaponid, ammo;
if(sscanf(params, "ui", id, target, weaponid, ammo)) return SendClientMessage(playerid, COLOR_WARN, "USAGE: /giveweapon [ID] [weaponid] [amount]");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid playerid!");
if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "You already can give yourself any weapons!");
GivePlayerWeapon(target);
SendClientMessage(playerid, COLOR_WARN, "You gave a weapon!");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You received a weapon!");
return 1;
}