14.07.2015, 00:09
PHP код:
CMD:givegun(playerid, params[])
{
new
userid,
ammo,
weapon;
if (pInfo[playerid][pAdmin] < 1)
return SendClientMessage(playerid, COLOR_RED, "[Server] Nemas dozvolu da koristis ovu komandu.");
if (sscanf(params, "uii", userid, weapon, ammo))
return SendClientMessage(playerid, -1, "Koristenje: /givegun [playerid / deo imena] [weapon id] [ammo]");
if (userid == INVALID_PLAYER_ID)
return SendClientMessage(playerid, COLOR_RED,"[Server] Igrac nije konektovan.");
GivePlayerWeapon(userid, weapon, ammo);
pInfo[userid][pWeapon] = weapon;
pInfo[userid][pAmmo] = ammo;
return 1;
}
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.