//====================================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; }
Originally Posted by SuperS82
@ www.******.com
Whats the problem with someone asking for some help around here. Instead of posting SEARCH or Whatever, why not stop being lazy and make an actual post thats not going to look LAZY? Anyways, if you still need some help with your /rob command, just let me know. I made a custom one for a roleplaying server with animations and timers, also made it give you a wanted level, sent a message to any online cops of the location being robbed, etc... etc... Was fun to make and use. |