slap command
#1

Hello,

Can someone help me with /slap command?
I want to add when you slap player you need to type in a reason why...

example; Mark_Wilson has been slapped by Admin, reason: mg

Im using GTARP mod.

Код:
//-----------------------------------[Slap]-----------------------------------------------
	if(strcmp(cmd, "/slap", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "KORISCENJE: /slap [ID Igraca/Dio Imena]");
				return 1;
			}
			new playa;
			new Float:shealth;
			new Float:slx, Float:sly, Float:slz;
			playa = ReturnUser(tmp);
			if (PlayerInfo[playerid][pAdmin] >=1)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
				        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						GetPlayerHealth(playa, shealth);
						SetPlayerHealth(playa, shealth-5);
						GetPlayerPos(playa, slx, sly, slz);
						SetPlayerPos(playa, slx, sly, slz+5);
						PlayerPlaySound(playa, 1130, slx, sly, slz+5);
						printf("[SLAP] %s je osamaren od strane Admina.",sendername,  giveplayer  );
						format(string, sizeof(string), "[SLAP] %s je osamaren od strane Admina ",giveplayer ,sendername  );
						BroadCast(COLOR_LIGHTRED,string);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "Nemate pristup ovoj komandi!");
			}
		}
		return 1;
	}
Reply


Messages In This Thread
slap command - by Felipee - 28.11.2013, 17:07
Re: slap command - by Felipee - 30.11.2013, 13:06
Re: slap command - by xVIP3Rx - 30.11.2013, 13:27
Re: slap command - by ReApZ - 30.11.2013, 14:10
Re: slap command - by newbie scripter - 30.11.2013, 14:26

Forum Jump:


Users browsing this thread: 1 Guest(s)