SA-MP Forums Archive
/newbie command help - 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: /newbie command help (/showthread.php?tid=245839)



/newbie command help - marwan - 02.04.2011

i have a simple /newbie command i get 4 errors here is the cmd and the errors
Код:
if(!strcmp(cmdtext, "/newbie", true))
	{
    format(string, sizeof(string), "[NEWBIE]: Newbie %s: %s", sendername, result);
    return 1;
    }
errors
Код:
C:\Documents and Settings\Marwan\Desktop\1\samp03csvr_win32\gamemodes\S.pwn(144) : error 017: undefined symbol "string"
C:\Documents and Settings\Marwan\Desktop\1\samp03csvr_win32\gamemodes\S.pwn(144) : error 017: undefined symbol "string"
C:\Documents and Settings\Marwan\Desktop\1\samp03csvr_win32\gamemodes\S.pwn(144) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Marwan\Desktop\1\samp03csvr_win32\gamemodes\S.pwn(144) : 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: /newbie command help - kiss - 02.04.2011

Try this:

pawn Код:
if(!strcmp(cmdtext, "/newbie", true))
    {
    new string[128];
    format(string, sizeof(string), "[NEWBIE]: Newbie %s: %s", sendername, result);
    return 1;
    }



Re: /newbie command help - marwan - 02.04.2011

now i have this error only
C:\Documents and Settings\Marwan\Desktop\1\samp03csvr_win32\gamemod es\S.pwn(145) : error 017: undefined symbol "sendername"


Re: /newbie command help - kiss - 02.04.2011

Ok, try this now

pawn Код:
if(!strcmp(cmdtext, "/newbie", true))
    {
    new string[128];
    new sendername[64];
    format(string, sizeof(string), "[NEWBIE]: Newbie %s: %s", sendername, result);
    return 1;
    }



Re: /newbie command help - spedico - 02.04.2011

Код:
if(!strcmp(cmdtext, "/newbie", true))
{
    new string[128], sendername[MAX_PLAYER_NAME], text[64];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "[NEWBIE]: Newbie %s: %s", sendername, text);
    SendClientMessageToAll(-1, string);
    return 1;
}
That would be right I guess. Except that you don't have any "method" to read the params. So it would just send a blank message.


Re: /newbie command help - marwan - 02.04.2011

@kiss
now it says undefined symbol result
@spedico
Quote:
Originally Posted by spedico
Посмотреть сообщение
Код:
if(!strcmp(cmdtext, "/newbie", true))
{
    new string[128], sendername[MAX_PLAYER_NAME], text[64];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "[NEWBIE]: Newbie %s: %s", sendername, text);
    SendClientMessageToAll(-1, string);
    return 1;
}
That would be right I guess. Except that you don't have any "method" to read the params. So it would just send a blank message.
now when i do /newbie it works but if i putted my text like /newbie hi it says unknown cmd


Re: /newbie command help - armyoftwo - 02.04.2011

pawn Код:
if(!strcmp(cmdtext, "/newbie", true))
{
    new string[128], sendername[MAX_PLAYER_NAME], text[64];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "[NEWBIE]: Newbie %s: %s", sendername, text);
    SendClientMessageToAll(string);
    return 1;
}



Re: /newbie command help - SchurmanCQC - 02.04.2011

Quote:
Originally Posted by armyoftwo
Посмотреть сообщение
pawn Код:
if(!strcmp(cmdtext, "/newbie", true))
{
    new string[128], sendername[MAX_PLAYER_NAME], text[64];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "[NEWBIE]: Newbie %s: %s", sendername, text);
    SendClientMessageToAll(string);
    return 1;
}
You forgot the color. xD

pawn Код:
if(!strcmp(cmdtext, "/newbie", true))
{
    new string[128], sendername[MAX_PLAYER_NAME], text[64];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "[NEWBIE]: Newbie %s: %s", sendername, text);
    SendClientMessageToAll(0xFFFFFFFF,string);
    return 1;
}



Re: /newbie command help - marwan - 02.04.2011

the same /newbie alone work when i put another thing it don't work nothing happen


Re: /newbie command help - marwan - 03.04.2011

sorry for 2 posts but please help me