SA-MP Forums Archive
i wan't make a /give command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: i wan't make a /give command (/showthread.php?tid=351234)



i wan't make a /give command - peterory - 15.06.2012

i wan't make a /give command
when player input /give [type] [giveplayerid]
then give that player a gun
and send a message
player give a gun to giveplayer
player give you a gun

can someone tell me ?
i will very thank him


Respuesta: i wan't make a /give command - CidadeNovaRP - 15.06.2012

Quote:
Originally Posted by peterory
Посмотреть сообщение
i wan't make a /give command
when player input /give [type] [giveplayerid]
then give that player a gun
and send a message
player give a gun to giveplayer
player give you a gun

can someone tell me ?
i will very thank him
pawn Код:
CMD:giveweapon(playerid, params[])
{
    new id, weapon, ammo, string[128];
    if(sscanf(params, "ud", id, weapon)) return SendClientMessage(playerid, COR_ERRO, "USEAGE: /giveweapon [ID] [WEAPONID]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COR_ERRO, "Player isn't online.");
    if(playerid == id) return SendClientMessage(playerid, COR_ERRO, "You don't give weapon for you.");
    GivePlayerWeapon(id, weapon, ammo);
    format(string, sizeof(string), "The player %s give you the weapon id %d, %d ammo.", GetName(playerid), arma, municao);
    SendClientMessage(id, -1, string);
    format(string, sizeof(string), "You give a %s the weapon id %d, %d ammo.", GetName(id), arma, municao);
    SendClientMessage(playerid, -1, string);
    return 1;
}



Re: Respuesta: i wan't make a /give command - peterory - 15.06.2012

Quote:
Originally Posted by CidadeNovaRP
Посмотреть сообщение
pawn Код:
CMD:giveweapon(playerid, params[])
{
    new id, weapon, ammo, string[128];
    if(sscanf(params, "ud", id, weapon)) return SendClientMessage(playerid, COR_ERRO, "USEAGE: /giveweapon [ID] [WEAPONID]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COR_ERRO, "Player isn't online.");
    if(playerid == id) return SendClientMessage(playerid, COR_ERRO, "You don't give weapon for you.");
    GivePlayerWeapon(id, weapon, ammo);
    format(string, sizeof(string), "The player %s give you the weapon id %d, %d ammo.", GetName(playerid), arma, municao);
    SendClientMessage(id, -1, string);
    format(string, sizeof(string), "You give a %s the weapon id %d, %d ammo.", GetName(id), arma, municao);
    SendClientMessage(playerid, -1, string);
    return 1;
}
thank you very much


Respuesta: Re: Respuesta: i wan't make a /give command - CidadeNovaRP - 15.06.2012

Quote:
Originally Posted by peterory
Посмотреть сообщение
thank you very much