Код:
if(strcmp(cmd, "/giveweapon", true) == 0)
{
if(PlayerInfo[playerid][Level] >= 2) {
new player1, tmp[256],weap,ammo;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, red, "USAGE: /giveweapon [playerid] [weapon id]");
return 1; }
player1 = strval(tmp);
tmp = strtok(cmdtext, idx);
weap = strval(tmp);
if(!IsValidWeapon(weap)) return SendClientMessage(playerid,red,"ERROR: Incorrect Weapon ID");
tmp = strtok(cmdtext, idx);
ammo = strval(tmp);
GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
if(IsPlayerConnected(player1)) {
CMDMessageToAdmins(playerid,"GIVEWEAPON");
GivePlayerWeapon(player1, weap, ammo);
format(string, sizeof(string), "You have given %s weapon id: %d with %d rounds of ammo", playername,weap,ammo); SendClientMessage(playerid,blue,string);
format(string,256,"Administrator %s has given you weapon id: %d with %d rounds of ammo",adminname,weap,ammo); if(player1 != playerid) { SendClientMessage(player1,blue,string); }
return 1;
} else {
SendClientMessage(playerid, red, "Player is not connected");
return 1; }
} else {
SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command"); }
return 1; }
gosh you almost 4x spamming the scripting discussion dude sometimes you need to script yourself not always asking. my script is created by me. my gamemode is created by me. my admin system is created by me.
Dude, your asking multiple questions in only one thread after completing first question and if your not getting answer your creating another thread. Just search around some tutorials there are tons of sscanf and zcmd tutorials through which you can create admin commands. Seacrh for a guy named Twisted_Insane he has created tons of tutorials about making admin command and stuff.