Making this smaller
#1

Hey guys. I'm using a script where you can make people cops..
But my script for that is waaaaay to long.
I have 9 cop levels.

They are like this:
Код:
dcmd_lspd2(playerid, params[]) {

  new PName[24];
	GetPlayerName(playerid, PName, 24);


 if(PlayerInfo[playerid][LSPDLEVEL] >= 8)
	{
	new target;
 	target = strval(params);
	if(!params[0]) return SendClientMessage(playerid, 0x2641FEAA, "ERROR: /lspd2 <playerid>");
  SendClientMessage(playerid,red,"You've made him/her LSPD rank 2");
	PlayerInfo[target][LSPDLEVEL] = 2;
	SendClientMessage(target,red,"You are now lspd rank 2");
	}
	else
	SendClientMessage(playerid,red,"You are not a lspd CL or HL");

	return 1;
}

dcmd_lspd3(playerid, params[]) {

  new PName[24];
	GetPlayerName(playerid, PName, 24);


	if(PlayerInfo[playerid][LSPDLEVEL] >= 8)
	{
	new target;
 	target = strval(params);
	if(!params[0]) return SendClientMessage(playerid, 0x2641FEAA, "ERROR: /lspd3 <playerid>");
  SendClientMessage(playerid,red,"You've made him/her LSPD rank 3");
	PlayerInfo[target][LSPDLEVEL] = 3;
	SendClientMessage(target,red,"You are now lspd rank 3");
	}
	else
	SendClientMessage(playerid,red,"You are not a lspd CL or HL");

	return 1;
}

dcmd_lspd4(playerid, params[]) {

  new PName[24];
	GetPlayerName(playerid, PName, 24);


	if(PlayerInfo[playerid][LSPDLEVEL] >= 8)
	{
	new target;
 	target = strval(params);
	if(!params[0]) return SendClientMessage(playerid, 0x2641FEAA, "ERROR: /lspd4 <playerid>");
  SendClientMessage(playerid,red,"You've made him/her LSPD rank 4");
	PlayerInfo[target][LSPDLEVEL] = 4;
	SendClientMessage(target,red,"You are now lspd rank 4");
	}
	else
	SendClientMessage(playerid,red,"You are not a lspd CL or HL");

	return 1;
}

dcmd_lspd5(playerid, params[]) {

  new PName[24];
	GetPlayerName(playerid, PName, 24);


	if(PlayerInfo[playerid][LSPDLEVEL] >= 8)
	{
	new target;
 	target = strval(params);
	if(!params[0]) return SendClientMessage(playerid, 0x2641FEAA, "ERROR: /lspd5 <playerid>");
  SendClientMessage(playerid,red,"You've made him/her LSPD rank 5");
	PlayerInfo[target][LSPDLEVEL] = 5;
	SendClientMessage(target,red,"You are now lspd rank 5");
	}
	else
	SendClientMessage(playerid,red,"You are not a lspd CL or HL");

	return 1;
}

dcmd_lspd6(playerid, params[]) {

  new PName[24];
	GetPlayerName(playerid, PName, 24);


	if(PlayerInfo[playerid][LSPDLEVEL] >= 8)
	{
	new target;
 	target = strval(params);
	if(!params[0]) return SendClientMessage(playerid, 0x2641FEAA, "ERROR: /lspd6 <playerid>");
  SendClientMessage(playerid,red,"You've made him/her LSPD rank 6");
	PlayerInfo[target][LSPDLEVEL] = 6;
	SendClientMessage(target,red,"You are now lspd rank 6");
	}
	else
	SendClientMessage(playerid,red,"You are not a lspd CL or HL");

	return 1;
}

dcmd_lspd7(playerid, params[]) {

  new PName[24];
	GetPlayerName(playerid, PName, 24);


	if(PlayerInfo[playerid][LSPDLEVEL] >= 8)
	{
	new target;
 	target = strval(params);
	if(!params[0]) return SendClientMessage(playerid, 0x2641FEAA, "ERROR: /lspd7 <playerid>");
  SendClientMessage(playerid,red,"You've made him/her LSPD rank 7");
	PlayerInfo[target][LSPDLEVEL] = 7;
	SendClientMessage(target,red,"You are now lspd rank 7");
	}
	else
	SendClientMessage(playerid,red,"You are not a lspd CL or HL");

	return 1;
}

dcmd_lspd8(playerid, params[]) {

  new PName[24];
	GetPlayerName(playerid, PName, 24);


	if(PlayerInfo[playerid][LSPDLEVEL] >= 8)
	{
	new target;
 	target = strval(params);
	if(!params[0]) return SendClientMessage(playerid, 0x2641FEAA, "ERROR: /lspd8 <playerid>");
  SendClientMessage(playerid,red,"You've made him/her LSPD rank 8");
	PlayerInfo[target][LSPDLEVEL] = 8;
	SendClientMessage(target,red,"You are now lspd rank 8");
	}
	else
	SendClientMessage(playerid,red,"You are not a lspd CL or HL");

	return 1;
}

dcmd_lspd9(playerid, params[]) {

  new PName[24];
	GetPlayerName(playerid, PName, 24);


	if(PlayerInfo[playerid][LSPDLEVEL] >= 8)
	{
	new target;
 	target = strval(params);
	if(!params[0]) return SendClientMessage(playerid, 0x2641FEAA, "ERROR: /lspd9 <playerid>");
  SendClientMessage(playerid,red,"You've made him/her LSPD rank 9");
	PlayerInfo[target][LSPDLEVEL] = 9;
	SendClientMessage(target,red,"You are now lspd rank 9");
	}
	else
	SendClientMessage(playerid,red,"You are not a lspd CL or HL");

	return 1;
}
Can anyone make these levels above here just in 1 command?
Like /lspd [id] [rank]?


Thanks in advance
Reply


Messages In This Thread
Making this smaller - by bartje01 - 30.05.2010, 09:55
Re: Making this smaller - by DJDhan - 30.05.2010, 10:58
Re: Making this smaller - by bartje01 - 30.05.2010, 11:10
Re: Making this smaller - by MadeMan - 30.05.2010, 11:14
Re: Making this smaller - by DJDhan - 30.05.2010, 11:22
Re: Making this smaller - by bartje01 - 30.05.2010, 11:27
Re: Making this smaller - by bartje01 - 30.05.2010, 11:36
Re: Making this smaller - by MadeMan - 30.05.2010, 12:10

Forum Jump:


Users browsing this thread: 1 Guest(s)