rob command
#3

Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
if (strcmp(cmd, "/Rob", true) == 0)
{
new tmp[256];
tmp = strtok( cmdtext, idx );
new Float:X, Float:y, Float:z;
new Float:u, Float:v, Float:w;
GetPlayerPos(playerid, X, y, z);
GetPlayerPos(strval(tmp), u, v, w);
if(GetPlayerMoney(strval(tmp)) <= 0)
{
SendClientMessage(playerid,0xFFFFFF,"He don't have money, so he can't be robbed");
return 1;
}
else if(IsPlayerInRangeOfPoint(strval(tmp),10.0,X,y,z))
{
new Money1 = GetPlayerMoney(strval(tmp));
new Money2 = random(Money1);

SetPlayerSpecialAction(strval(tmp),SPECIAL_ACTION_ HANDSUP);
SendClientMessage(strval(tmp), 0xFFFFFF, "You've been robbed!");
GivePlayerMoney(strval(tmp), -Money2);
GivePlayerMoney(playerid, Money2);
return 1;
}
}
return 0;
}

Something like that?
Reply


Messages In This Thread
rob command - by [Lsrcr]Rafa - 25.08.2010, 10:13
Re: rob command - by LarzI - 25.08.2010, 10:18
Re: rob command - by gangstajoe - 25.08.2010, 10:21
Re: rob command - by [Lsrcr]Rafa - 25.08.2010, 10:40
Re: rob command - by gangstajoe - 25.08.2010, 10:50
Re: rob command - by [Lsrcr]Rafa - 25.08.2010, 11:07
Re: rob command - by gangstajoe - 25.08.2010, 11:20
Re: rob command - by [Lsrcr]Rafa - 25.08.2010, 11:26

Forum Jump:


Users browsing this thread: 1 Guest(s)