Command help..
#1

I Made a command based on a FS (Kinda noob at this)

So please help me to make it work.. it gives me alot of errors... idk how to fix, please help me.

pawn Код:
CMD:sendgun(playerid, params[]);
{
    new string[156], tmp[256], tmp2[256], weaponname[50], Index; tmp = strtok(params, Index); tmp2 = strtok(params,Index);
    if(!strlen(tmp) || !strlen(tmp2)) return SendClientMessage(playerid, -1, "Usage: /givegun [playerid] [ammo]");
    new player1, ammo, weapon, weapon1, slot; player1=strval(tmp); ammo=strval(tmp2);
    if(playerid==player1) return SendClientMessage(playerid, 0xFF0000, "You can't send guns to yourself!");
    if(ammo<1) return SendClientMessage(playerid, 0xFF0000, "Why mind on giving 0 ammo ! ! !");
    weapon = GetPlayerWeapon(playerid; weapon1=GetPlayerWeapon(player1);
    if(weapon==0) return SendClientMessage(playerid, 0xFF0000, "You are disarmed, you can't give guns..");
    slot=GetWeaponSlot(weapon);
    if(savedammo[playerid][slot]<ammo) return SendClientMessage(playerid, 0xFF0000, "You don't have this amount of ammo!");
    savedammo[playerid][slot]-=ammo;
    GetWeaponName(weapon, weaponname, 50);
    format(string, sizeof(string), "%s[%d]:  has sent you a %s with %d ammo.", pName(playerid), playerid, weaponname, ammo);
    SendClientMessage(playerid, -1, string);
    format(string, sizeof(string), " You have sent %s[%d]: a %s with %d ammo.", pName(player1), player1, weaponname, ammo);
    SendClientMessage(playerid, -1, string);
    GivePlayerWeapon(player1, weapon, ammo);
    GivePlayerWeapon(player1, weapon1, 0);
    GivePlayerWeapon(playerid, weapon, 0);
    return 1;
}
It does give the gun a player is holding to another player it gives the gun with a certain ammo.. idk how to make it work if anyone could make it i'd be very grateful, thanks.

PS: I Took this from a very OLD filterscript, so please if you could make it better it'd be awesome with sscanf if possible... PLEASE!
Reply
#2

Hello , You should put it in the GM not as a FS .
Reply
#3

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)