Help again....
#1

Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/kill", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid, COLOR_GREY, "You have commited suicide!!");
GivePlayerMoney(playerid,-1500);
SendClientMessage(playerid, COLOR_RED, "Hospital bills has been taken off, Thanks for your visit.");
return 0;
}
}

If they do /kill, There money goes off 2x and the red Text appears 2x? How do i make it 1X.
Reply
#2

Perhaps:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/kill", true)==0)
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid, COLOR_GREY, "You have commited suicide!!");
GivePlayerMoney(playerid,-1500);
SendClientMessage(playerid, COLOR_RED, "Hospital bills has been taken off, Thanks for your visit.");
return 1;
}
}
Reply
#3

Than this comes :
J:\Spellen\Samp server\filterscripts\Commands.pwn(10 : warning 209: function "OnPlayerCommandText" should return a value
Reply
#4

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/kill", true)==0)
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid, COLOR_GREY, "You have commited suicide!!");
GivePlayerMoney(playerid,-1500);
SendClientMessage(playerid, COLOR_RED, "Hospital bills has been taken off, Thanks for your visit.");
return 1;
}
return 0;
}
This way.
Reply
#5

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/kill", true)==0)
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid, COLOR_GREY, "You have commited suicide!!");
GivePlayerMoney(playerid,-1500);
SendClientMessage(playerid, COLOR_RED, "Hospital bills has been taken off, Thanks for your visit.");
return 1;
}
}
	
return SendClientMessage(playerid,COLOR_RED,"* There is no such command!");
}
Maybe you have Skype? It would be much easier to help you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)