SA-MP Forums Archive
5 errors. (again, this time with /b) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 5 errors. (again, this time with /b) (/showthread.php?tid=245892)

Pages: 1 2


5 errors. (again, this time with /b) - davelord - 02.04.2011

errors
Quote:

C:\Users\Mijn pc\Desktop\test one.pwn(89) : error 017: undefined symbol "cmd"
C:\Users\Mijn pc\Desktop\test one.pwn(93) : error 017: undefined symbol "sendername"
C:\Users\Mijn pc\Desktop\test one.pwn(93) : error 017: undefined symbol "sendername"
C:\Users\Mijn pc\Desktop\test one.pwn(93) : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\test one.pwn(93) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.

command
Quote:

if(strcmp(cmd, "/b", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
GetPlayerName(playerid, sendername, MAX_PLAYER_NAME);
for (new i = 0; i < MAX_PLAYER_NAME; i++)
if (sendername[i] == '_')
sendername[i] = ' ';
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;
}

ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_F ADE4,COLOR_FADE5);
}
return 1;
}




Re: 5 errors. (again, this time with /b) - Jeffry - 02.04.2011

pawn Код:
if(!strcmp(cmdtext, "/b", true, 2) && cmdtext[2] == ' ')
{
    if(strlen(cmdtext) == 3)
    {
        SendClientMessage(playerid, 0xFF0000FF, "USAGE: /b [local ooc chat]");
        return 1;
    }
    new str[128];
    GetPlayerName(playerid, str, sizeof(str));
    format(str, sizeof(str), "[OOC-Chat] %s: %s", str, cmdtext[4]);
    ProxDetector(20.0, playerid, str,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_F ADE4,COLOR_FADE5);
    return 1;
Should fix it.

Jeffry


Re: 5 errors. (again, this time with /b) - xir - 02.04.2011

pawn Код:
if(strcmp(cmdtext, "/b", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new sendername[128];
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
GetPlayerName(playerid, sendername, MAX_PLAYER_NAME);
for (new i = 0; i < MAX_PLAYER_NAME; i++)
if (sendername[i] == '_')
sendername[i] = ' ';
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;
}

ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_F ADE4,COLOR_FADE5);
}
return 1;
}



Re: 5 errors. (again, this time with /b) - davelord - 02.04.2011

When I tried the /b ingame, it didnt work.


Re: 5 errors. (again, this time with /b) - Jeffry - 02.04.2011

Quote:
Originally Posted by davelord
Посмотреть сообщение
When I tried the /b ingame, it didnt work.
Tried mine?


Re: 5 errors. (again, this time with /b) - davelord - 02.04.2011

Yeah. Xir's one crashed my Pawno. Anyways, the /me command is working properly, but when I type /b [text] nothing appears.


Re: 5 errors. (again, this time with /b) - Jeffry - 02.04.2011

pawn Код:
if(!strcmp(cmdtext, "/b", true, 2) && cmdtext[2] == ' ')
{
    if(strlen(cmdtext) == 3)
    {
        SendClientMessage(playerid, 0xFF0000FF, "USAGE: /b [local ooc chat]");
        return 1;
    }
    new str[128], plName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, plName, sizeof(plName));
    format(str, sizeof(str), "[OOC-Chat] %s: %s", plName, cmdtext[3]);
    ProxDetector(20.0, playerid, str,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_F ADE4,COLOR_FADE5);
    return 1;
}
Try this version. ^^


Re: 5 errors. (again, this time with /b) - davelord - 02.04.2011

I only get this:
Quote:

C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 89) : warning 217: loose indentation
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 99) : error 017: undefined symbol "ProxDetector"
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 99) : error 017: undefined symbol "ADE4"
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 99) : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 99) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.




Re: 5 errors. (again, this time with /b) - Jeffry - 02.04.2011

pawn Код:
ProxDetector(20.0, playerid, str,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
There was somehow a space in the colors.

Should work now.


Re: 5 errors. (again, this time with /b) - davelord - 02.04.2011

Still;
Quote:

C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 89) : warning 217: loose indentation
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 99) : error 017: undefined symbol "ProxDetector"
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 99) : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 99 -- 100) : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 99 -- 100) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.




Re: 5 errors. (again, this time with /b) - SchurmanCQC - 02.04.2011

pawn Код:
if(!strcmp(cmdtext, "/b", true, 2) == 0)
{
    if(!strlen(cmdtext)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /b [local ooc chat]");
    new str[128], plName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, plName, sizeof(plName));
    format(str, sizeof(str), "[OOC-Chat] %s: %s", plName, cmdtext);
    ProxDetector(20.0, playerid, str,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_F ADE4,COLOR_FADE5);
    return 1;
}



Re: 5 errors. (again, this time with /b) - bijoyekuza - 02.04.2011

Use dcmd/sscanf


Re: 5 errors. (again, this time with /b) - davelord - 02.04.2011

Works but I got one error.
Quote:

C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 89) : warning 217: loose indentation
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 89) : warning 213: tag mismatch
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 95) : error 017: undefined symbol "ProxDetector"
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 9 : warning 209: function "OnPlayerCommandText" should return a value
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.




Re: 5 errors. (again, this time with /b) - Jeffry - 02.04.2011

Do you even have the 'ProxDetector' in your script?
If not, change
pawn Код:
ProxDetector(20.0, playerid, str,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
to
pawn Код:
SendClientMessageToAll(COLOR_FADE1, str);

@What Schurman posted: Won't work correctly.


Re: 5 errors. (again, this time with /b) - davelord - 02.04.2011

Oh but I want the /b only to appear people in rage. For example; a player needs to be 5 meter close or else he wont see it.


Re: 5 errors. (again, this time with /b) - SchurmanCQC - 02.04.2011

Make sure you have ProxDetector defined. If you're adding this command to the BOTTOM of onplayercommandtext use this.

pawn Код:
if(!strcmp(cmdtext, "/b", true, 2) == 0)
{
    if(!strlen(cmdtext)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /b [local ooc chat]");
    new str[128], plName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, plName, sizeof(plName));
    format(str, sizeof(str), "[OOC-Chat] %s: %s", plName, cmdtext);
    ProxDetector(20.0, playerid, str,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_F ADE4,COLOR_FADE5);
    return 0;
}



Re: 5 errors. (again, this time with /b) - Jeffry - 02.04.2011

You get the ProxDetector from here: http://forum.sa-mp.com/showpost.php?...42&postcount=3
and then this will work:
pawn Код:
if(!strcmp(cmdtext, "/b", true, 2) && cmdtext[2] == ' ')
{
    if(strlen(cmdtext) == 3)
    {
        SendClientMessage(playerid, 0xFF0000FF, "USAGE: /b [local ooc chat]");
        return 1;
    }
    new str[128], plName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, plName, sizeof(plName));
    format(str, sizeof(str), "[OOC-Chat] %s: %s", plName, cmdtext[3]);
    ProxDetector(20.0, playerid, str,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
    return 1;
}
(Hopefully)^^


Re: 5 errors. (again, this time with /b) - davelord - 02.04.2011

No idea on how to install it.


Re: 5 errors. (again, this time with /b) - Jeffry - 02.04.2011

Quote:
Originally Posted by davelord
Посмотреть сообщение
No idea on how to install it.
Just put it into your script. At Bottom.


Re: 5 errors. (again, this time with /b) - davelord - 02.04.2011

LOOOOOOL

Quote:

C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 89) : warning 217: loose indentation
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 99) : error 035: argument type mismatch (argument 3)
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 102) : warning 209: function "OnPlayerCommandText" should return a value
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 104) : error 001: expected token: ")", but found "&"
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 104) : error 001: expected token: ";", but found "&"
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 106) : error 001: expected token: ")", but found "&"
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 106) : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 10 : error 010: invalid function or declaration
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 113) : error 021: symbol already defined: "GetPlayerPos"
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 115) : error 010: invalid function or declaration
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 117) : error 010: invalid function or declaration
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 120) : error 021: symbol already defined: "GetPlayerPos"
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 125) : error 010: invalid function or declaration
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 129) : error 010: invalid function or declaration
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 133) : error 010: invalid function or declaration
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 137) : error 010: invalid function or declaration
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 141) : error 010: invalid function or declaration
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 14 : error 010: invalid function or declaration
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 150) : warning 203: symbol is never used: "oldposx"
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 150) : warning 203: symbol is never used: "oldposy"
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 150) : warning 203: symbol is never used: "oldposz"
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 150) : warning 203: symbol is never used: "posx"
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 150) : warning 203: symbol is never used: "posy"
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 150) : warning 203: symbol is never used: "posz"
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 150) : warning 203: symbol is never used: "tempposx"
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 150) : warning 203: symbol is never used: "tempposy"
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 150) : warning 203: symbol is never used: "tempposz"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


16 Errors.