31.07.2013, 19:55
hey i want to add more team to use this command is /rob and only thied can use it how can i make rapist terrorist to use it?
Quote:
d(rob, playerid, params[]) { new ID; new string[120]; if(gTeam[playerid] != Team_Steal) return SendClientMessage(playerid, COLOR_ERROR, "Only Theifs can use this command."); if(GetPVarInt(playerid, "Jailed") == 1) return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command in jail."); if(GetPVarInt(playerid, "Cuffed") == 1) return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command while cuffed."); if(sscanf(params, "u", ID)) return SendClientMessage(playerid, COLOR_ERROR, "Usage: /rob (ID)"); if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_ERROR, "Invalid Player ID."); if(GetDistanceBetweenPlayers(playerid, ID) > 5) return SendClientMessage(playerid, COLOR_ERROR, "That player is too far away."); if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command while in a vehicle."); if(IsPlayerInAnyVehicle(ID)) return SendClientMessage(playerid, COLOR_ERROR, "You cannot rob them when they are in a vehicle."); if(GetPVarInt(playerid, "RobbedPlayerRecent") >= 1) return SendClientMessage(playerid, COLOR_ERROR, "You must wait before robbing a player again."); new chance = random(10); if(chance == 1) return SendClientMessage(playerid, COLOR_ERROR, "You failed the robbery."); new mrand = random(GetPlayerMoney(ID)); if(GetPlayerMoney(ID) <=0) return SendClientMessage(playerid, COLOR_ERROR, "That player doesn't have any money."); new current_zone = player_zone[playerid]; if(IsCop(ID)) { format(string, 120, "[ROBBED] %s has robbed $%d from you!", PlayerInfo(playerid), mrand); SendClientMessage(ID, COLOR_RED, string); format(string, 120, "[ROBBERY] You robbed $%d from %s!", mrand, PlayerInfo(ID)); SendClientMessage(playerid, COLOR_RED, string); format(string, 120, "[ROBBERY] %s robbed $%d from %s!", PlayerInfo(playerid), mrand, PlayerInfo(ID)); SendClientMessageToAll(COLOR_LIGHTBLUE, string); CNR_PrintString(string); format(string, 120, "[DISPATCH] %s has been robbed by %s. Location: %s", PlayerInfo(ID), PlayerInfo(playerid), playerid,zones[current_zone][zone_name]); SendCopMessage(string); format(string, 120, "Type /radioof to turn off the Police Radio."); SendCopMessage(string); IncreaseWantedLevel(playerid, 2); IncreaseScore(playerid, 2); if(GetPVarInt(playerid, "RobSkill") <= 3) { SetPVarInt(playerid, "RobSkill", GetPVarInt(playerid, "RobSkill") +1); format(string, 120, "[SKILL UPGRADE] Your robbing skill has increased. Read /robjob."); SendClientMessage(playerid, COLOR_GREY, string); } return 1; } format(string, 120, "[ROBBED] %s has robbed $%d from you!", PlayerInfo(playerid), mrand); SendClientMessage(ID, COLOR_RED, string); format(string, 120, "[ROBBERY] You robbed $%d from %s!", mrand, PlayerInfo(ID)); SendClientMessage(playerid, COLOR_RED, string); format(string, 120, "[ROBBERY] %s robbed $%d from %s!", PlayerInfo(playerid), mrand, PlayerInfo(ID)); SendClientMessageToAll(COLOR_LIGHTBLUE, string); CNR_PrintString(string); format(string, 120, "[DISPATCH] %s has been robbed by %s. Location: %s", PlayerInfo(ID), PlayerInfo(playerid), playerid,zones[current_zone][zone_name]); SendCopMessage(string); format(string, 120, "Type /radioof to turn off the Police Radio."); SendCopMessage(string); IncreaseWantedLevel(playerid, 1); IncreaseScore(playerid, 1); if(GetPVarInt(playerid, "RobSkill") <= 3) { SetPVarInt(playerid, "RobSkill", GetPVarInt(playerid, "RobSkill") +1); format(string, 120, "[SKILL UPGRADE] Your robbing skill has increased. Read /robjob."); SendClientMessage(playerid, COLOR_GREY, string); } return 1; |