/sethealth and string
#3

got 3 more cmds i need help with. This:


pawn Код:
CMD:giveweapon(playerid, params[])
{
   if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, 0x99333300, "You can't make your own commands smartass!");
   new PID, reason[64], ammo, weaponid;
   new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];

   if(sscanf(params, "uis(No Reason)", PID, weaponid, ammo, reason)) return SendClientMessage(playerid, 0xFF0000C8, "USAGE: /giveweapon [playerid] [weaponid] [ammo] [reason]");

   GetPlayerName(playerid, Adminname, sizeof(Adminname));
   GetPlayerName(PID, Playername, sizeof(Playername));

   if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, 0xFF0000C8, "Player is not Connected!");

   new str[150];
   format(str,sizeof(str),"%s's got a weapon from Admin %s (ID %s. Ammo: %s)Reason: %s", Playername,Adminname, weaponid, ammo, reason);
   SendClientMessageToAll(0xFF0000C8, str);
   GivePlayerWeapon(PID, weaponid, ammo);
   SendClientMessage(PID, 0xFF000000,"An admin changed your kills!");
   return 1;
}
CMD:setmod(playerid, params[])
{
   if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, 0x99333300, "You can't make your own commands smartass!");
   new PID;
   new str[128];
   new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
   if(sscanf(params, "u", PID)) return SendClientMessage(playerid, 0xFF0000C8, "USAGE: /setmod [playerid]");
   GetPlayerName(playerid, Adminname, sizeof(Adminname));
   GetPlayerName(PID, Playername, sizeof(Playername));

   if(PlayerInfo[PID][pAdmin] == 1) return SendClientMessage(playerid,0xFF0000FF, "That person is already moderator!");

   if(!IsPlayerConnected(PID))
       return SendClientMessage(playerid, 0xFF0000C8, "Player is not Connected!");

   format(str,sizeof(str),"Owner %s made %s moderator. (Level: 1)", Adminname, Playername);
   SendClientMessageToAll(0xFF0000C8, str);
   PlayerInfo[PID][pAdmin] = 1;
   SendClientMessage(PID, 0xFF000000,"You have been made an moderator!");
   return 1;
}
CMD:freeze(playerid, params[])
{
   if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, 0x99333300, "You can't make your own commands smartass!");
   new PID, reason[64];
   new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];

   if(sscanf(params, "uis(No Reason)", PID, reason)) return SendClientMessage(playerid, 0xFF0000C8, "USAGE: /freeze [playerid] [reason]");

   GetPlayerName(playerid, Adminname, sizeof(Adminname));
   GetPlayerName(PID, Playername, sizeof(Playername));

   if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, 0xFF0000C8, "Player is not Connected!");

   new str[150];
   format(str,sizeof(str),"%s have been freezed by Admin %s. Reason: %s", Playername, Adminname, reason);
   SendClientMessageToAll(0xFF0000C8, str);
   TogglePlayerControllable(PID, 0);
   SendClientMessage(PID, 0xFF000000,"An admin freezed you!");
   return 1;
}
Reply


Messages In This Thread
/sethealth and string - by Qaiis - 08.09.2012, 12:55
Re: /sethealth and string - by clarencecuzz - 08.09.2012, 13:05
Re: /sethealth and string - by Qaiis - 08.09.2012, 13:53
Re: /sethealth and string - by HuSs3n - 08.09.2012, 13:56

Forum Jump:


Users browsing this thread: 1 Guest(s)