[SOLVED]Stuck at /rob command
#3

Код:
//====================================Rob=======================================
dcmd_rob(playerid, params[])
{
if(RobTimer1[playerid] == 1)
{
	SendClientMessage(playerid, COLOR_RED, "You must wait 15 sec to do that again!");
	return 1;
}
	if (strlen(params))
	{
		id = strval(params);
		if (IsPlayerConnected(id) && (gTeam[playerid] == TEAM_CIVIL))
		{
	 		if(GetDistanceBetweenPlayers( playerid, id) < 3.0 )
	 		{
		    if(id != playerid)
				{
				  if(PunishTime[playerid] != 1)
				  {
				    if(GetPlayerMoney(id) >= 250)
						{
						new rob[ 256 ];
		  	  	new robmoney = random( 500 );
		  	  	format( rob, sizeof( rob ), "You have been robbed, -%d$.",robmoney );
    				SendClientMessage( id, COLOR_RED, rob );
    				format( rob, sizeof( rob ), "You have robbed the player,for $%d.",robmoney );
    				SendClientMessage( playerid, COLOR_YELLOW, rob );
						GivePlayerMoney(playerid, robmoney);
						GivePlayerMoney(id, -robmoney);
						SetPlayerScore(playerid, GetPlayerScore( playerid ) +1 );
						SetPlayerWantedLevel( playerid, GetPlayerWantedLevel( playerid )+1 );
						GameTextForPlayer(id, "~r~You have been Robbed", 3500, 3);
						RobTimer1[playerid] = 1;
						SetPlayerScore(id, GetPlayerScore( id ) -1 );
			      SetTimerEx("FartTimerOff", 15000, false, "d", playerid);
			      format(Message,sizeof(Message),"*Police Dispatch* Robbery in progress, calling all cars. [Location: %s]",ReturnPlayerZone(playerid));
    				SendMessageToTeam( TEAM_COPS, COLOR_BLUE,Message);
    				format(Message,sizeof(Message),"*Agents Dispatch* Robbery in progress, calling all cars. [Location: %s]",ReturnPlayerZone(playerid));
    				SendMessageToTeam( TEAM_CIA, COLOR_WHITE,Message);
    				LoopingAnim(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 1, 0, 0, 0, 0); // Rob
						}
						else
						{
						SendClientMessage(playerid, COLOR_RED , "This player has not money, to rob him!");
						}
					}
					else
					{
					SendClientMessage(playerid, COLOR_RED , "You can not use commands in prison!");
					}
				}
				else
				{
				SendClientMessage(playerid, COLOR_RED , "You can not rob your self!");
				}
			}
			else
			{
			SendClientMessage(playerid, COLOR_RED , "There is no player nearby!");
			}
		}
		else
		{
		SendClientMessage(playerid, COLOR_RED , "You are not a Civilian to use this, or there is no player nearby.");
		}
	}
	else
	{
	SendClientMessage(playerid, COLOR_RED, "Usage: \"/rob <playerid>\"");
	}
return 1;
}
That is an example for my cops and robbers server! i hope help you
Reply


Messages In This Thread
[SOLVED]Stuck at /rob command - by x-unit - 16.01.2010, 11:35
Re: Stuck at /rob command - by Retardedwolf - 16.01.2010, 11:38
Re: Stuck at /rob command - by akis_tze - 16.01.2010, 12:11
Re: Stuck at /rob command - by x-unit - 16.01.2010, 15:07
Re: Stuck at /rob command - by SuperS82 - 16.01.2010, 15:53
Re: Stuck at /rob command - by x-unit - 16.01.2010, 16:07
Re: Stuck at /rob command - by x-unit - 16.01.2010, 16:13
Re: Stuck at /rob command - by SuperS82 - 16.01.2010, 16:14
[SOLVED]Stuck at /rob command - by x-unit - 16.01.2010, 17:24

Forum Jump:


Users browsing this thread: 5 Guest(s)