SA-MP Forums Archive
/skill command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /skill command (/showthread.php?tid=66316)



/skill command - StrickenKid - 21.02.2009

im making a cops and robbers server and i need help making the /skill command and i have no idea how to start, if anyone could be nice enough please type up a starter script so i can get a basis of how and what to do, thx in advance.


Re: /skill command - hantuafiq2 - 24.11.2009

nice avatar xD


Re: /skill command - Blunts - 24.11.2009

I didn't make this.. BMUK and Frozenrat did.

Код:
  if(strcmp(cmd,"/skill",true)==0)
	{
  if(IsSpawned[playerid] == 0) {
	SendClientMessage(playerid, COLOR_ERROR, "You are dead. You cannot use this command");
  return 1;
  }
    
  if(canchooseskill[playerid] == 0) {
	SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command now. Only certain teams can use this at time of spawn");
  return 1;
  }
	  if(IsPlayerConnected(playerid))
	  {
	    new x_nr[256];
			x_nr = strtok(cmdtext, idx);
			if(!strlen(x_nr)) {
				SendClientMessage(playerid, COLOR_ROYALBLUE,"Use: /skill 1-6 to select your chosen skill. Default skill (Rapist) Will be given if you dont choose");
		 		SendClientMessage(playerid, 0x00C7FFAA, "1. Rapist");
		 		SendClientMessage(playerid, 0x00C7FFAA, "2. Drug Dealer");
		 		SendClientMessage(playerid, 0x00C7FFAA, "3. GunDealer");
		 		SendClientMessage(playerid, 0x00C7FFAA, "4. Hitman");
		 		SendClientMessage(playerid, 0x00C7FFAA, "5. Private Medic");
		 		SendClientMessage(playerid, 0x00C7FFAA, "6. Bounty Hunter");
		 		
				return 1;
			}
		  if(strcmp(x_nr,"1",true) == 0)// Rapist
			{
			  SendClientMessage(playerid,0x1E90FFAA, "Type /commands for your commands");
		    SendClientMessage(playerid,0x1E90FFAA, "RAPIST: You can rape other players and infect them with STDs that could kill them");

        GivePlayerWeapon(playerid,5,1);
        GivePlayerWeapon(playerid,22,100);
        GivePlayerWeapon(playerid,14,1);
        gTeam[playerid] = TEAM_RAPIST;
        SetPlayerToTeamColour(playerid);
        canchooseskill[playerid] =0;
        TextDrawHideForPlayer(playerid,txtTypeSkill);
       
        
			}
			else if(strcmp(x_nr,"2",true) == 0)//Drug Dealer
			{
        SendClientMessage(playerid,0x1E90FFAA, "Type /commands for your commands");
		    SendClientMessage(playerid,0x00FFFFAA, "DRUG DEALER: You will supply people with drugs for a price. Dont let people rip you off..");
        SendClientMessage(playerid,0x00FFFFAA, "Keep a watch on the chat for players wanting drugs. Visit the drug house to replenish your stock");
        GivePlayerWeapon(playerid,25,50);
        GivePlayerWeapon(playerid,28,100);
        GivePlayerWeapon(playerid,5,1);
        gTeam[playerid] = TEAM_DRGDEL;
        SetPlayerToTeamColour(playerid);
        PlayerDrugs[playerid] = 500;
        canchooseskill[playerid] =0;
        TextDrawHideForPlayer(playerid,txtTypeSkill);
        
			}
No credits to me... thank them.