Argument type mismatch (Type 2) -
R3G1ST3R - 09.06.2011
Code:
if(strcmp(cmd, "/b", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[96];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /b [local ooc chat]");
return 1;
}
else
{
format(string, sizeof(string), "[L-OOC]%s: %s ", sendername, result);
}
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
}
return 1;
is my /b command, and I get the error, can any one help?
===Better?
Re: Argument type mismatch (Type 2) -
yarrum3 - 09.06.2011
Use pawn tabs when posting code so i can read it
Re: Argument type mismatch (Type 2) -
R3G1ST3R - 09.06.2011
Edited, thanks.
Re: Argument type mismatch (Type 2) -
[DDC]Delight - 09.06.2011
Quote:
Originally Posted by R3G1ST3R
pawn Code:
if(strcmp(cmd, "/b", true) == 0) { if(IsPlayerConnected(playerid)) { if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !"); return 1; } GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[96]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /b [local ooc chat]"); return 1; } else { format(string, sizeof(string), "[L-OOC]%s: %s ", sendername, result); } ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); } return 1;
is my /b command, and I get the error, can any one help?
|
at which line?
Re: Argument type mismatch (Type 2) -
R3G1ST3R - 09.06.2011
C:\Documents and Settings\xxxxxx\Desktop\Server\gamemodes\crp.pwn(1 330) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Documents and Settings\xxxxxx\Desktop\Server\gamemodes\crp.pwn(1 766) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\xxxxxx\Desktop\Server\gamemodes\crp.pwn(1 766) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\xxxxxx\Desktop\Server\gamemodes\crp.pwn(1 793) : warning 225: unreachable code
C:\Documents and Settings\xxxxxx\Desktop\Server\gamemodes\crp.pwn(1 793) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Re: Argument type mismatch (Type 2) -
[DDC]Delight - 09.06.2011
Quote:
Originally Posted by R3G1ST3R
C:\Documents and Settings\xxxxxx\Desktop\Server\gamemodes\crp.pwn(1 330) : warning 219: local variable "sendername" shadows a variable at a preceding level
|
Can be easy fixed, by replacing all the 'sendername' in the command by a different name.
Example: giveplayer
On which lines you got the argument type mismatched?
Re: Argument type mismatch (Type 2) -
kazai - 09.06.2011
What's the line number of
Code:
if(strcmp(cmd, "/b", true) == 0)
Just for reference?
Re: Argument type mismatch (Type 2) -
[DDC]Delight - 09.06.2011
Quote:
Originally Posted by kazai
What's the line number of
Code:
if(strcmp(cmd, "/b", true) == 0)
Just for reference?
|
EDIT: nvm
Re: Argument type mismatch (Type 2) -
R3G1ST3R - 09.06.2011
1757 Is the /b line number
Re: Argument type mismatch (Type 2) -
R3G1ST3R - 09.06.2011
Quote:
Originally Posted by [DDC]Delight
Can be easy fixed, by replacing all the 'sendername' in the command by a different name.
Example: giveplayer
On which lines you got the argument type mismatched?
|
What do you mean? Im a nooby scripter, and I just want to get a /b command so I can turn my roleplay server online.