27.05.2012, 15:11
How i can do the command when someone rob house and its send auto messega to owner of the house
"ur house robbed"
"ur house robbed"
Код:
if(strcmp(cmd,"/sellrob",true)==0) { new tmpcar = GetPlayerVehicleID(playerid); if(PlayerInfo[playerid][pJob] == 10) { if(!IsARobTruck(tmpcar)) return SendClientMessage(playerid, COLOR_GREY, " Вы не в грузовике с краденым!"); if(!IsPlayerInRangeOfPoint(playerid,10,365.29998779,-88.19999695,1.00000000)) return SendClientMessage(playerid, COLOR_GREY, " Вы не на месте сбыта краденого!"); if(PlayerInfo[playerid][pRob] != 0) { GivePlayerMoney(playerid,PlayerInfo[playerid][pRob]*50); format(string,sizeof(string)," ИНФО: Вы заработали %d$ за украденные вещи",PlayerInfo[playerid][pRob]*50); SendClientMessage(playerid,COLOR_WHITE,string); SendClientMessage(, COLOR_RED, " Вам сообщили, что ваш дом обокрали!"); SendClientMessage(o, COLOR_RED, " Затраты на украденные вещи: %d$",PlayerInfo[playerid][pRob]*50); DisablePlayerCheckpoint(playerid); PlayerInfo[playerid][pRob] = 0; SetPlayerCriminal(playerid,255, " Воровство"); robhouse2[playerid] = 0; robhouse3[playerid] = 0; return 1; } else return SendClientMessage(playerid,COLOR_WHITE," Вы ничего не украли!"); } else { SendClientMessage(playerid, COLOR_GREY, " ИНФО: Вы не вор!"); } return 1; }
Код:
if(strcmp(cmd,"/houserob",true)==0) { for(new h = 0; h < sizeof(HouseInfo); h++) { if(PlayerInfo[playerid][pJob] == 10) { if(PlayerInfo[playerid][pRobSkill] < 45) return SendClientMessage(playerid, COLOR_GREY, " Ваш навык воровства слишком мал, чтобы выносить вещи!"); if(HouseInfo[h][hOwned] == 0) return SendClientMessage(playerid, COLOR_GREY, " У этого дома нет владельца!"); if(robhouse3[playerid] ==1) return SendClientMessage(playerid, COLOR_GREY, " Вы уже взяли вещь"); if(robhouse[playerid] !=0) return SendClientMessage(playerid, COLOR_GREY, " Вы уже грабили дом в этом часу"); if(IsPlayerInRangeOfPoint(playerid,10,HouseInfo[h][hExitx], HouseInfo[h][hExity], HouseInfo[h][hExitz])) { switch(random(4)) { case 0: { SendClientMessage(playerid, COLOR_GREEN, "Вы украли видеомагнитофон, погрузите награбленное в воровской грузовик: /loadrob"); SetPlayerAttachedObject(playerid,1,1783,1,0.11,0.36,0.0,0.0,90.0); ClearAnimations(playerid); ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,1,0,0,1,1,1); SetPlayerCheckpoint(playerid,365.29998779,-88.19999695,1.00000000,4.0); GetPlayerName(playerid, sendername, sizeof(sendername)); SendClientMessage(playerid, COLOR_WHITE, "Место сбыта краденого помечено красной меткой"); robhouse3[playerid] = 1; robhouse2[playerid] = 1; } case 1: { SendClientMessage(playerid, COLOR_GREEN, "Вы украли телевизор, погрузите награбленное в воровской грузовик: /loadrob"); SetPlayerAttachedObject(playerid,1,2648,1,0.11,0.36,0.0,0.0,90.0); ClearAnimations(playerid); ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,1,0,0,1,1,1); SetPlayerCheckpoint(playerid,365.29998779,-88.19999695,1.00000000,4.0); GetPlayerName(playerid, sendername, sizeof(sendername)); SendClientMessage(playerid, COLOR_WHITE, "Место сбыта краденого помечено красной меткой"); robhouse3[playerid] = 1; robhouse2[playerid] = 1; } case 2: { SendClientMessage(playerid, COLOR_GREEN, "Вы украли магнитофон, погрузите награбленное в воровской грузовик: /loadrob"); SetPlayerAttachedObject(playerid,1,2102,1,0.11,0.36,0.0,0.0,90.0); ClearAnimations(playerid); ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,1,0,0,1,1,1); SetPlayerCheckpoint(playerid,365.29998779,-88.19999695,1.00000000,4.0); GetPlayerName(playerid, sendername, sizeof(sendername)); SendClientMessage(playerid, COLOR_WHITE, "Место сбыта краденого помечено красной меткой"); robhouse3[playerid] = 1; robhouse2[playerid] = 1; } case 3: { SendClientMessage(playerid, COLOR_GREEN, "Вы украли игровую приставку, погрузите награбленное в воровской грузовик: /loadrob"); SetPlayerAttachedObject(playerid,1,2028,1,0.11,0.36,0.0,0.0,90.0); ClearAnimations(playerid); ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,1,0,0,1,1,1); SetPlayerCheckpoint(playerid,365.29998779,-88.19999695,1.00000000,4.0); GetPlayerName(playerid, sendername, sizeof(sendername)); SendClientMessage(playerid, COLOR_WHITE, "Место сбыта краденого помечено красной меткой"); robhouse3[playerid] = 1; robhouse2[playerid] = 1; } } return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " ИНФО: Вы не вор!"); } } return 1; }
Код:
SendClientMessage([House owner what i need to put here to send auto message to owner of the house?], COLOR_RED, " Вам сообщили, что ваш дом обокрали!");