Author Topic: Warning That I dont Get  (Read 3673 times)

0 Members and 1 Guest are viewing this topic.

Offline kitt85711

  • Wiseguy
  • **
  • Posts: 72
    • View Profile
Warning That I dont Get
« on: July 23, 2012, 11:25:34 am »
I have this on my suspect command

[pawn]else if (IsCop [plr] == 1) SendClientMessage(playerid, COLOR_YELLOW,"*****[Error] %s Is A Cop!*****", gPlayers[playerid]);[/pawn]

And it gives me this warning and when I try it in the server it doesn't work. I spawn as a cop and it still suspects me. And I tried to make an else if that made it so you cant suspect someone that is already wanted but it uses the same thing the IsSuspected[plr]. Can someone help? P.S. Please can someone get back to me on that jail command

Offline cocky

  • Street Thug
  • *
  • Posts: 24
    • View Profile
Re: Warning That I dont Get
« Reply #1 on: July 23, 2012, 01:04:15 pm »
[pawn]else if (IsCop [plr] == 1) SendClientMessage(playerid, COLOR_YELLOW,"*****[Error] %s Is A Cop!*****", gPlayers[playerid]);[/pawn]

Is plr defined? What is the warning? the script line you provided does not contain any other errors.

Offline kitt85711

  • Wiseguy
  • **
  • Posts: 72
    • View Profile
Re: Warning That I dont Get
« Reply #2 on: July 23, 2012, 01:30:11 pm »
Plr is defined [pawn]plr = FindPlayerIDFromString(tmp)[/pawn] and here is the warning.

CnR.pwn(1643) : warning 202: number of arguments does not match definition

Offline Bemito

  • Street Thug
  • *
  • Posts: 2
    • View Profile
Re: Warning That I dont Get
« Reply #3 on: July 23, 2012, 02:17:16 pm »
Plr is defined [pawn]plr = FindPlayerIDFromString(tmp)[/pawn] and here is the warning.

CnR.pwn(1643) : warning 202: number of arguments does not match definition
It looks like you forgot to add " ; " at the end.

[pawn] plr = FindPlayerIDFromString(tmp);[/pawn]


Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Re: Warning That I dont Get
« Reply #4 on: July 23, 2012, 04:33:30 pm »
Although I don't script Pawn anymore, but I still can remember it like it was yesterday...
[pawn]else if (IsCop [plr] == 1) SendClientMessage(playerid, COLOR_YELLOW,"*****[Error] %s Is A Cop!*****", gPlayers[playerid]);[/pawn]
The SendClientMessage functions won't support your gPlayer[playerid]. Try something like:
[pawn]
else if( IsCop[ plr ] == 1 )
{
    new szMsg[ 128 ];
    format( szMsg, sizeof( szMsg ), "*****[Error] %s is a cop!******", gPlayer[playerid] );
    SendClientMessage( playerid, COLOR_YELLOW, szMsg );
    return 1;
}
[/pawn]
There maybe some nuts and bolts loose or missing because I can't really recall most of the arguments and functions.. I only remember the Pawn syntax...  :-X
I'm beginning to feel like a Lag God, Lag God

Offline kitt85711

  • Wiseguy
  • **
  • Posts: 72
    • View Profile
Re: Warning That I dont Get
« Reply #5 on: July 23, 2012, 05:49:42 pm »
I'll try Fuzzy, and Bemito, I didn't forget the ; because it has two others X, plr, X; and I only copied it out of the middle.

Offline kitt85711

  • Wiseguy
  • **
  • Posts: 72
    • View Profile
Re: Warning That I dont Get
« Reply #6 on: July 23, 2012, 06:04:30 pm »
Thanks fuzzy :D I just had to fix it up a lil bit :) "gPlayer" to gPlayers and then

[pawn]else if( IsCop[ plr ] == 1 )
{
    new szMsg[ 128 ];
    format( szMsg, sizeof( szMsg ), "*****[Error] %s is a cop!******", gPlayer[playerid] );
    SendClientMessage( playerid, COLOR_YELLOW, szMsg );
    return 1;
}[/pawn]


Make this look like This


[pawn]else if( IsCop[ plr ] == 1 ) {

format( szMsg, sizeof( szMsg ), "*****[Error] %s is a cop!******", gPlayer[playerid] );
SendClientMessage( playerid, COLOR_YELLOW, szMsg );
}[/pawn]