09.03.2015, 09:04
No...look at my code.
Just make sth like this:
And the Command you press InGame is:
Greekz
Just make sth like this:
Код:
CMD:giveweapon(playerid,params[]) { new string[128],id,weapon,pAmmo,pName[MAX_PLAYER_NAME]; if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,STEALTH_BLUE,"You need to be level 3 to give someone weapons."); if(sscanf(params,"udd",id,weapon,pAmmo)) return SendClientMessage(playerid,STEALTH_BLUE,"USAGE: /giveweapon [id] [weaponid] [ammo]"),PostWeaponList(playerid); if(!IsPlayerConnected(id)) return SendClientMessage(playerid,STEALTH_BLUE,"That player is not connected!"); if(weapon <= 0 || weapon > 46 || weapon == 19 || weapon == 20 || weapon == 21 || weapon == 22) return SendClientMessage(playerid, COLOR_INDIANRED,"This is not a valid weapon name! PLease try again"); GivePlayerWeapon(id,weapon,pAmmo),GetPlayerName(playerid,pName,sizeof pName); format(string,sizeof(string),"Administrator %s has given you %s with %d ammo.",pName,WeaponNames[weapon],pAmmo); SendClientMessage(playerid,COLOR_DARKORCHID,string),GetPlayerName(id,pName,sizeof pName); format(string,sizeof(string),"You have given %s %s with %d ammo.",pName,WeaponNames[weapon],pAmmo); SendClientMessage(playerid,COLOR_DARKORCHID,string),CMDMessageToAdmins(playerid,"GIVEWEAPON"); return 1; } stock PostWeaponList(playerid) { SendClientMessage(playerid,-1,"Possible weaponids:"); for(new i=1,tmp[64]; i<47; i++) { if (i == 19 || i == 20 || i == 21) continue; format(tmp,64,"weaponid: %d | Name: %s",i,WeaponNames[i]); SendClientMessage(playerid,-1,tmp); } return 1; }
Код:
/giveweapon 0 24 500 /* Instead of using eagle, press 24 (the WEAPONID) */