#1

i made a rob command and here is the code

PHP код:
CMD:rob(playeridparams[])
{
new 
targetid;
if(
sscanf(params"u"targetid)) return SendClientMessage(playeridCOLOR_WHITE"Usage: /rob [id]");
if(!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_RED"This player is not connected");
new 
Float:xFloat:yFloat:z;
new 
tPos GetPlayerPos(targetidxyz);
if(!
IsPlayerInRangeOfPoint(playerid5xyz)) return SendClientMessage(playeridCOLOR_RED"This player is too far away");
if(
GetPlayerMoney(targetid) < 1000) return SendClientMessage(playeridCOLOR_RED"This player doesn't have enough money");
new 
money GetPlayerMoney(targetid);
GivePlayerMoney(playeridmoney 10);
GivePlayerMoney(targetid, -money 10);
new 
name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
GetPlayerName(playeridnamesizeof(name));
new 
name2[MAX_PLAYER_NAME], string1[24+MAX_PLAYER_NAME];
GetPlayerName(targetidname2sizeof(name2));
format(string,sizeof(string),"%s has robbed %s",namename2);
SendClientMessage(playeridCOLOR_SILVER"You robbed %d"money);
SendClientMessage(targetidCOLOR_SILVER"You got robbed and lost %d"money/10);
SendClientMessageToAll(COLOR_GREEN,string);
return 
1;

It works but when i rob someone i doesn't send the amount of money in the chat it give the player the amount of money but i doesn't do in the chat

Reply


Messages In This Thread
Rob - by nezo2001 - 05.01.2015, 11:09
Re: Rob - by Banana_Ghost - 05.01.2015, 11:25
Re: Rob - by nezo2001 - 05.01.2015, 11:31
Re: Rob - by Banana_Ghost - 05.01.2015, 11:33
Re: Rob - by nezo2001 - 05.01.2015, 11:35
Re: Rob - by Banana_Ghost - 05.01.2015, 11:37
Re: Rob - by nezo2001 - 05.01.2015, 11:49
Re: Rob - by Banana_Ghost - 05.01.2015, 11:56
Re: Rob - by nezo2001 - 05.01.2015, 12:13
Re: Rob - by Banana_Ghost - 05.01.2015, 12:16

Forum Jump:


Users browsing this thread: 1 Guest(s)