Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: kitt85711 on July 23, 2012, 11:25:34 am

Title: Warning That I dont Get
Post by: kitt85711 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
Title: Re: Warning That I dont Get
Post by: cocky 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.
Title: Re: Warning That I dont Get
Post by: kitt85711 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
Title: Re: Warning That I dont Get
Post by: Bemito 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]
Title: Re: Warning That I dont Get
Post by: Fuzzy168 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
Title: Re: Warning That I dont Get
Post by: kitt85711 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.
Title: Re: Warning That I dont Get
Post by: kitt85711 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]