29.10.2013, 23:06
Heres the pawno code:
When I try to rob it it says something about it being disabled, which I didn't do.. The stuff under the first 4 or so lines are to rob a normal person.. Just added it so you can get more of the code to know how its been coded and stuuuuuuff
))
pawn Код:
CMD:robbiz(playerid, params[])
{
SendClientMessage(playerid, COLOR_BLUE, "Business Robbery has been disabled due to the fact > Abuse");
return 1;
}
#define MAX_ROBCASH 4000
new randomrobmoney;
CMD:rob(playerid, params[])
{
new playerb, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pJob] != JOB_THIEF && PlayerInfo[playerid][pVIPJob] != JOB_THIEF) return SendClientMessage(playerid, COLOR_GREY, "You are not a Thief.");
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /rob [playerid]");
if(playerid == playerb) return SendClientMessage(playerid, COLOR_GREY, "You can't rob yourself.");
if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
if(PlayerInfo[playerb][pMoney] < 4000) return SendClientMessage(playerid, COLOR_GREY, "This player don't have enough on-hand");
//if(IsPlayerNearPlayer(playerid, playerb, 2)) return SendClientMessage(playerid, COLOR_GREY, "You are not close enough at the player");
if(IsPlayerNearPlayer(playerid, playerb, 2))
{
if(robtime[playerid] == 0)
{
new rob = random(4);
if(rob == 1)
{
format(string, sizeof(string), "* %s has tried to take money from %s his pocket", RPN(playerid), RPN(playerb));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
robtime[playerid] = 1;
SetTimerEx("robtimer", ROB_TIME, false, "i", playerid);
}
else if(rob == 2)
{
format(string, sizeof(string), "* %s has tried to take money from %s his pocket", RPN(playerid), RPN(playerb));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
robtime[playerid] = 1;
SetTimerEx("robtimer", ROB_TIME, false, "i", playerid);
}
else if(rob == 3)
{
format(string, sizeof(string), "* %s has stolen some money from %s his pocket", RPN(playerid), RPN(playerb));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
randomrobmoney = random(MAX_ROBCASH);
GiveZaiatMoney(playerid,randomrobmoney);
GiveZaiatMoney(playerb,randomrobmoney);
format(string, sizeof(string), "* You've stolen %d from %s", randomrobmoney, RPN(playerid));
SendClientMessage(playerb, COLOR_PURPLE,string);
format(string, sizeof(string), "* %s has stolen %d from you", RPN(playerb), randomrobmoney);
SendClientMessage(playerid, COLOR_PURPLE, string);
robtime[playerid] = 1;
SetTimerEx("robtimer", ROB_TIME, false, "i", playerid);
}
else if(rob == 4)
{
format(string, sizeof(string), "* %s has tried to take money from %s his pocket", RPN(playerid), RPN(playerb));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
robtime[playerid] = 1;
SetTimerEx("robtimer", ROB_TIME, false, "i", playerid);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Wait before you can rob someone again.");
}
}
return 1;
}
When I try to rob it it says something about it being disabled, which I didn't do.. The stuff under the first 4 or so lines are to rob a normal person.. Just added it so you can get more of the code to know how its been coded and stuuuuuuff
))



:P