rob command
#1

hello guys i want someone help me with the /rob [id] command.
please post it the pawn code for it... thanks
Reply
#2

If you want someone to make the code for you, post in Script Request.
Reply
#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
#4

hmm this is not soo good script have much errors !
Reply
#5

Quote:
Originally Posted by [Lsrcr]Rafa
Посмотреть сообщение
hmm this is not soo good script have much errors !
yeah, i just noticed.
if you replace SPECIAL_ACTION_ HANDSUP with SPECIAL_ACTION_HANDSUP, and include a_samp and gl_common.inc, it will be ok.

the good version:
Quote:

#define FILTERSCRIPT

#include <a_samp>
#include "../include/gl_common.inc"

#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n------------------------");
print(" Rob Script Activated");
print("------------------------\n");
}
#endif

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;
}

Reply
#6

again have error but i fix it
btw thanks
Reply
#7

Quote:
Originally Posted by [Lsrcr]Rafa
Посмотреть сообщение
again have error but i fix it
btw thanks
hm, i didn't get any errors, but ok..
you're welcome
Reply
#8

can i have ur msn or something u have pm me if u want to tell me
i aprecitate this man
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)