Problem with params.
#6

I don't think you're all getting what I mean.
I still want the cop to get a message when he kills an innocent person...

I have a command that check's who's wanted. If a cop kills the wanted person he gets that message. It's because:
"if(GetPlayerWantedLevel(killerid) == 0)"
needs to be
"if(GetPlayerWantedLevel(ID) == 0)".


I have to reveal my suspect script for you to explain.
ID = the person that is going to be wanted.
playerid isn't. So when I try to add "new ID =...." under onplayerdeath, I get a params error.

Код:
dcmd_sus1(const playerid,const params[])
{
    new ID = strval(params);
    if(gTeam[playerid] == Cops && gTeam[ID] != Cops)
    {
        new name[MAX_PLAYER_NAME], string[48];
		GetPlayerName(ID, name, sizeof(name));
		format(string, sizeof(string), "%s is now wanted by the police.", name );
 		SendClientMessageToAll(COLOR_RED, string);
		return SendClientMessage(ID,0xf9f9f9f9,"You are now wanted by the police."), SetPlayerWantedLevel(ID, 3);
Update.
I removed new ID = strval(params); from the above script.
That resulted in me adding myself as wanted. Obviously it didn't work because the following bit doesn't allow it.
So obviously I needed replace playerid with another word.
"if(gTeam[playerid] == Cops && gTeam[ID] != Cops)"
Reply


Messages In This Thread
Problem with params. - by Juanxz - 28.11.2010, 19:14
Re: Problem with params. - by JaTochNietDan - 28.11.2010, 20:05
Re: Problem with params. - by Juanxz - 28.11.2010, 21:05
Re: Problem with params. - by randomkid88 - 28.11.2010, 21:11
Re: Problem with params. - by JaTochNietDan - 28.11.2010, 21:46
Re: Problem with params. - by Juanxz - 29.11.2010, 09:19
Re: Problem with params. - by JaTochNietDan - 29.11.2010, 10:05
Re: Problem with params. - by Juanxz - 29.11.2010, 13:08

Forum Jump:


Users browsing this thread: 1 Guest(s)