zcmd(robar, playerid, params[]) { if(PlayerInfo[playerid][pJailed] > 0) return Message(playerid, COLOR_GREY, "No puedes usar esto aquн."); if(Pandilleros(playerid) || PlayerInfo[playerid][pJob] == 5) { if(!sscanf(params, "s[32]", params[0])) { new string[128]; if(strcmp(params[0],"persona",true) == 0) { if(PlayerInfo[playerid][pRob] > 4) return Message(playerid, COLOR_GRAD2, "ЎYa has robado 5 veces, espera al prуximo PayDay!"); new victim = GetClosestPlayer(playerid); if(ProxDetectorS(2.0,playerid, victim)) { if(GetPlayerWeapon(victim) == 41) { format(string, sizeof(string), "%s intenta robarle a %s sin que se de cuenta y falla", PlayerName(playerid), PlayerName(victim)); ProxDetector(30.0, playerid, string, COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED); format(string, sizeof(string), "* %s le rocнa la cara con un spray anti-ladrones a %s.", PlayerName(victim), PlayerName(playerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); PlayerInfo[playerid][pRob] += 1; Message(victim, COLOR_YELLOW2, "-> ЎEvitaste que te robaran!"); } new rob = random(2); if(rob == 1) { PlayerInfo[victim][pPnumber] = 0; format(string, sizeof(string), "%s intenta robarle a %s sin que se de cuenta y lo logra", PlayerName(playerid) ,PlayerName(victim)); ProxDetector(30.0, playerid, string, COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN); format(string, sizeof(string), "* %s se acerca hacia %s y le roba su telйfono.", PlayerName(playerid) ,PlayerName(victim)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); Message(victim, COLOR_YELLOW2, "-> ЎTe han robado el telйfono!"); Message(playerid, COLOR_YELLOW2, "-> ЎHas robado un telйfono! Vйndelo en el NPC"); PlayerInfo[playerid][pRob] += 1; TelfRob[playerid] += 1; } else { format(string, sizeof(string), "%s intenta robarle a %s sin que se de cuenta y falla", PlayerName(playerid), PlayerName(victim)); ProxDetector(30.0, playerid, string, COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED); format(string, sizeof(string), "* %s se da cuenta y le da un golpe de puсo a %s.", PlayerName(victim), PlayerName(playerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); Message(victim, COLOR_GREEN, "-> Has evitado que te roben!"); Message(playerid, COLOR_YELLOW, "Te han pillado Jilipollas! Menudo ostiуn te has llevado! Corre!"); PlayerInfo[playerid][pRob] += 1; } } } else if(strcmp(params[0],"24-7",true) == 0) { if(!IsAt247(playerid)) return Message(playerid, COLOR_GRAD2, "ЎNo estбs en el 24/7!"); if(PlayerInfo[playerid][pRob] > 0) return Message(playerid, COLOR_GRAD2, "ЎYa robaste, espera al prуximo PayDay!"); else { new robmoney = random(2200); Earn(playerid, robmoney); ApplyAnimation(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 0, 0, 0, 0, 4000); // Rob PlayerInfo[playerid][pRob] += 1; format(string, sizeof(string), "* %s amenaza con un arma al vendedor", PlayerName(playerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } else if(strcmp(params[0],"propiedad",true) == 0) { if(PickLock[playerid] == 0) return Message(playerid, COLOR_GRAD2, "ЎNo tienes con que forzar la cerradura!"); if(PlayerInfo[playerid][pRob] > 0) return Message(playerid, COLOR_GRAD2, "ЎYa robaste, espera al prуximo PayDay!"); for(new i = 0; i < sizeof(HouseInfo); i++) { if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez])) { new Float:cx,Float:cy,Float:cz; GetPlayerPos(playerid, cx, cy, cz); new luck = random(8) if(luck == 3 || luck == 7) { format(string, sizeof(string), "* %s fuerza la cerradura de la casa, entra y roba todo lo que puede.", PlayerName(playerid)); ProxDetector(8.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); new cash = random(6000); PlayerInfo[playerid][pRob] = 1; SendRadioMessage(1, TEAM_BLUE_COLOR, "** Central: Atenciуn se ha producido un robo en una casa de la Ciudad, No tenemos el lugar exacto!"); for(new x = 0; x < MAX_PLAYERS; x++) { if(IsPlayerConnected(x)) { if(Team_LSPD(playerid)) { SetPlayerCheckpoint(x, cx, cy, cz, 3.0); } } } Earn(playerid, cash); ProxDetector(30.0, playerid, "* Piiiiiiiiiiiiiiii Piiiiiiiiiiiiiiiii (( Alarma Sonando ))", COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW); return 1; } else { format(string, sizeof(string), "* %s rompe su alambre al intentar forzar la cerradura.", PlayerName(playerid)); ProxDetector(8.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SendClientMessage(playerid, COLOR_YELLOW2, "Fallaste al abrir la casa ..."); PlayerInfo[playerid][pRob] = 1; return 1; } } else Message(playerid, COLOR_GRAD2, "ЎNo estбs cerca de una casa!"); } } } else Message(playerid, COLOR_GRAD2, "Utilize: /robar <24-7> <Persona> <Propiedad>"); } return 1; }
CMD:robar(playerid, params[])
{
if(PlayerInfo[playerid][pJailed] > 0)
return Message(playerid, COLOR_GREY, "No puedes usar esto aquн.");
if(Pandilleros(playerid) || PlayerInfo[playerid][pJob] == 5)
{
if(sscanf(params, "s[32]", params[0]))
return Message(playerid, COLOR_GRAD2, "Utilize: /robar <24-7> <Persona> <Propiedad>");
new
string[128];
if(strcmp(params[0],"persona",true) == 0)
{
if(PlayerInfo[playerid][pRob] > 4)
return Message(playerid, COLOR_GRAD2, "ЎYa has robado 5 veces, espera al prуximo PayDay!");
new victim = GetClosestPlayer(playerid);
if(!ProxDetectorS(2.0,playerid, victim))
return Message(playerid, COLOR_GRAD2, "No estas cerca del jugador!");
if(GetPlayerWeapon(victim) == 41)
{
format(string, sizeof(string), "%s intenta robarle a %s sin que se de cuenta y falla", PlayerName(playerid), PlayerName(victim));
ProxDetector(30.0, playerid, string, COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED);
format(string, sizeof(string), "* %s le rocнa la cara con un spray anti-ladrones a %s.", PlayerName(victim), PlayerName(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
PlayerInfo[playerid][pRob] += 1;
Message(victim, COLOR_YELLOW2, "-> ЎEvitaste que te robaran!");
}
new rob = random(2);
if(rob == 1)
{
PlayerInfo[victim][pPnumber] = 0;
format(string, sizeof(string), "%s intenta robarle a %s sin que se de cuenta y lo logra", PlayerName(playerid) ,PlayerName(victim));
ProxDetector(30.0, playerid, string, COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN);
format(string, sizeof(string), "* %s se acerca hacia %s y le roba su telйfono.", PlayerName(playerid) ,PlayerName(victim));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
Message(victim, COLOR_YELLOW2, "-> ЎTe han robado el telйfono!");
Message(playerid, COLOR_YELLOW2, "-> ЎHas robado un telйfono! Vйndelo en el NPC");
PlayerInfo[playerid][pRob] += 1;
TelfRob[playerid] += 1;
}
else
{
format(string, sizeof(string), "%s intenta robarle a %s sin que se de cuenta y falla", PlayerName(playerid), PlayerName(victim));
ProxDetector(30.0, playerid, string, COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED);
format(string, sizeof(string), "* %s se da cuenta y le da un golpe de puсo a %s.", PlayerName(victim), PlayerName(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
Message(victim, COLOR_GREEN, "-> Has evitado que te roben!");
Message(playerid, COLOR_YELLOW, "Te han pillado Jilipollas! Menudo ostiуn te has llevado! Corre!");
PlayerInfo[playerid][pRob] += 1;
}
}
else if(strcmp(params[0],"24-7",true) == 0)
{
if(!IsAt247(playerid))
return Message(playerid, COLOR_GRAD2, "ЎNo estбs en el 24/7!");
if(PlayerInfo[playerid][pRob] > 0)
return Message(playerid, COLOR_GRAD2, "ЎYa robaste, espera al prуximo PayDay!");
new robmoney = random(2200);
Earn(playerid, robmoney);
ApplyAnimation(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 0, 0, 0, 0, 4000); // Rob
PlayerInfo[playerid][pRob] += 1;
format(string, sizeof(string), "* %s amenaza con un arma al vendedor", PlayerName(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else if(strcmp(params[0],"propiedad",true) == 0)
{
if(PickLock[playerid] == 0)
return Message(playerid, COLOR_GRAD2, "ЎNo tienes con que forzar la cerradura!");
if(PlayerInfo[playerid][pRob] > 0)
return Message(playerid, COLOR_GRAD2, "ЎYa robaste, espera al prуximo PayDay!");
new
i = PlayerIsNearHouse(playerid)
;
if(i == -1)
return Message(playerid, COLOR_GRAD2, "ЎNo estбs cerca de una casa!");
new Float:cx,Float:cy,Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
new luck = random(8);
if(luck == 3 || luck == 7)
{
format(string, sizeof(string), "* %s fuerza la cerradura de la casa, entra y roba todo lo que puede.", PlayerName(playerid));
ProxDetector(8.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new cash = random(6000);
PlayerInfo[playerid][pRob] = 1;
SendRadioMessage(1, TEAM_BLUE_COLOR, "** Central: Atenciуn se ha producido un robo en una casa de la Ciudad, No tenemos el lugar exacto!");
for(new x = 0; x < MAX_PLAYERS; x++)
{
if(!IsPlayerConnected(x))
continue;
if(!Team_LSPD(playerid))
continue;
SetPlayerCheckpoint(x, cx, cy, cz, 3.0);
}
Earn(playerid, cash);
ProxDetector(30.0, playerid, "* Piiiiiiiiiiiiiiii Piiiiiiiiiiiiiiiii (( Alarma Sonando ))", COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
return 1;
}
else
{
format(string, sizeof(string), "* %s rompe su alambre al intentar forzar la cerradura.", PlayerName(playerid));
ProxDetector(8.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_YELLOW2, "Fallaste al abrir la casa ...");
PlayerInfo[playerid][pRob] = 1;
return 1;
}
}
}
return 1;
}
stock PlayerIsNearHouse(playerid, Float:radius = 3.0)
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if(PlayerToPoint(radius, playerid, HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
{
return i;
}
}
return -1;
}
PHP код:
|