dcmd_w2(playerid, params[])
{
new idx, iString[128];
iString = strtok(params, idx);
if (!strlen(iString)) {
SendClientMessage(playerid, COLOR_RED, "[USAGE]: /w2 [WEAPON ID/NAME] [AMMO] or /weapon [WEAPON ID/NAME] [AMMO]");
return true;
}
new weaponid = GetWeaponModelIDFromName(iString);
if (weaponid == -1) {
weaponid = strval(iString);
if (weaponid < 0 || weaponid > 47) {
SendClientMessage(playerid, COLOR_RED, "[ERROR]: Invalid WEAPON ID/NAME.");
return true;
}
}
if (!strlen(params[idx+1])) {
GivePlayerWeapon(playerid, weaponid, 500);
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(iString, 128, "%s were given weapon %s (ID: %d) with 500 ammo.",pName, aWeaponNames[weaponid], weaponid);
SendClientMessageToAll(COLOR_PINK, iString);
return true;
}
idx = strval(params[idx+1]);
GivePlayerWeapon(playerid, weaponid, idx);
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(iString, 128, "%s were given weapon %s (ID: %d) with %d ammo.",pName, aWeaponNames[weaponid], weaponid, idx);
SendClientMessageToAll(COLOR_PINK, iString);
return true;
}
if (weaponid == -1)
if (weaponid == -1 || weaponid == 38)
|
Originally Posted by JeNkStAX
replace
Код:
if (weaponid == -1) Код:
if (weaponid == -1 || weaponid == 38) |
|
Originally Posted by <3 HardStyle <3 | LarzI
It's [pawn] not [pawno]
![]() |