givegun
#1

PHP код:
CMD:givegun(playeridparams[])
{
    new
        
userid,
        
ammo,
        
weapon;
        
    if (
pInfo[playerid][pAdmin] < 1)
        return 
SendClientMessage(playeridCOLOR_RED"[Server] Nemas dozvolu da koristis ovu komandu.");
    if (
sscanf(params"uii"useridweaponammo))
        return 
SendClientMessage(playerid, -1"Koristenje: /givegun [playerid / deo imena] [weapon id] [ammo]");
    if (
userid == INVALID_PLAYER_ID)
        return 
SendClientMessage(playeridCOLOR_RED,"[Server] Igrac nije konektovan.");
        
    
GivePlayerWeapon(useridweaponammo);
    
    
pInfo[userid][pWeapon] = weapon;
    
pInfo[userid][pAmmo] = ammo;
    
    return 
1;

That is my givegun command, and it works, but what I want here is to make

format like this, so if you can see there is "Deagle" but I don't know how to write it in code, so when I type weaponid 24 (that is Deagle) it shows in format Deagle instead of 24.
[AdmCmd] You have recieved 10 bullets of Deagle from Name_Surname
So if you translate it into code it would be like this

format(string, sizeof(string),"[AdmCmd] You have recieved %d bullets of %s from %s", ammo, DontKnowWhatToTypeHere, PlayerName(playerid);
SCM(.....);

I used ****** but I can't find good explanation for that.
Reply


Messages In This Thread
givegun - by 025Tadija - 14.07.2015, 00:09
Re: givegun - by SickAttack - 14.07.2015, 00:14
Re: givegun - by 025Tadija - 14.07.2015, 00:15
Re : givegun - by KillerDVX - 14.07.2015, 01:08
Re: givegun - by 025Tadija - 14.07.2015, 12:34

Forum Jump:


Users browsing this thread: 1 Guest(s)