04.02.2009, 20:28
Yh right, if i putted ths into my admin script, tah /w2 cmd to spawn weapons. Ehm, i ONLY wanna block 1 weapon. And that is minigun. I will make it to an admin weapon, af course blocked for non-admins, is that possilble? (/w2 code token from the Debug made by Simon)
:P
Код:
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; }