Small Sscanf issue .. +REPP for help
#9

Thats not working too , but u gave me idea (+rep) , finally i got this working..

Btw , if someone else is searching for this heres code


Код:
dcmd_rape(playerid,params[])
{
  	new ID = GetClosestPlayerToPlayer(playerid);
 	new string[128];
 	if(gTeam[playerid] != CIVILIAN)
	{
	    SendClientMessage(playerid,COLOR_RED,"Only Civilians can rape other players.");
	    return 1;
	}
 	if(sscanf(params, "u", ID))
	{
		ID=GetClosestPlayerToPlayer(playerid);
		if(GetDistanceBetweenPlayers(playerid,ID) > 8)
		{
		    SendClientMessage(playerid,COLOR_RED,"No players around.");
		    return 1;
		}
		if(HasRapedRecently[playerid] > 1)
		{
		    SendClientMessage(playerid,COLOR_RED,"Please wait before raping someone again.");
		    return 1;
		}
	}
	if(!IsPlayerConnected(ID))
	{
	    format(string,sizeof(string),"The player ID (%d) is not connected to the server.",ID);
	    SendClientMessage(playerid,COLOR_RED,string);
	    return 1;
	}
	if(GetDistanceBetweenPlayers(playerid,ID) > 4)
	{
	    SendClientMessage(playerid,COLOR_RED,"That Player Is Not Close Enough");
	    return 1;
	}
	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
	{
	    SendClientMessage(playerid,COLOR_RED,"You cannot rape someone while in a vehicle. Exit the vehicle first.");
	    return 1;
	}
	if(GetPlayerState(ID) == PLAYER_STATE_DRIVER || GetPlayerState(ID) == PLAYER_STATE_PASSENGER)
	{
	    SendClientMessage(playerid,COLOR_RED,"You cannot rape someone while they are in a vehicle. Get them to exit the vehicle first.");
	    return 1;
	}
	if(IsSpawned[ID] != 1)
	{
	    format(string,sizeof(string),"%s(%d) is not spawned. You cannot rape dead people.",PlayerName(ID),ID);
	    SendClientMessage(playerid,COLOR_RED,string);
	    return 1;
	}
	if(HasRapedRecently[playerid] > 1)
	{
	    SendClientMessage(playerid,COLOR_RED,"Please wait before raping someone again.");
	    return 1;
	}
 	new Float:phealth;
	GetPlayerHealth(ID,phealth);
	HasRapedRecently[playerid] =15;
	SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
	SetPlayerHealth(ID, phealth-5);
	format(string,sizeof(string),"%s (%d) has raped %s (%d).",PlayerName(playerid),playerid,PlayerName(ID),ID);
	SendClientMessageToAll(COLOR_ORANGE,string);
	return 1;
}
Reply


Messages In This Thread
Small Sscanf issue .. +REPP for help - by DonWade - 29.12.2011, 19:19
Re: Small Sscanf issue .. +REPP for help - by DonWade - 30.12.2011, 13:52
Re: Small Sscanf issue .. +REPP for help - by HuSs3n - 30.12.2011, 15:26
Re: Small Sscanf issue .. +REPP for help - by [O.z]Caroline - 30.12.2011, 17:29
Re: Small Sscanf issue .. +REPP for help - by Dark_Kostas - 30.12.2011, 17:36
Re: Small Sscanf issue .. +REPP for help - by DonWade - 30.12.2011, 19:44
Re: Small Sscanf issue .. +REPP for help - by DonWade - 01.01.2012, 12:52
Re: Small Sscanf issue .. +REPP for help - by Babul - 01.01.2012, 13:19
Re: Small Sscanf issue .. +REPP for help - by DonWade - 01.01.2012, 14:01
Re: Small Sscanf issue .. +REPP for help - by Dark_Kostas - 01.01.2012, 14:32

Forum Jump:


Users browsing this thread: 1 Guest(s)