String ERROR - 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: String ERROR (
/showthread.php?tid=193465)
String ERROR -
AzTeCaS - 26.11.2010
Код:
//===============================================================================================================//
if(strcmp(cmd, "/announce", true) == 0)
{
new length = strlen(cmdtext);
if(adminlevel[playerid] < 1 ) return 0;
else
if(logged[playerid] == 0) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use commands because you are not logged in.");
else
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
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: /announce [text]");
return 1;
}
GameTextForAll(result, 5000, 0);
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "Admin %s has used /announce command", pName);
SendClientMessageToAdmins(COLOR_WHITE, string);
return 1;
}
//===============================================================================================================//
if(strcmp(cmd, "/chatannounce", true) == 0)
{
if(adminlevel[playerid] < 1 ) return 0;
else
if(logged[playerid] == 0) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use commands because you are not logged in.");
else
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
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: /chatannounce [text]");
return 1;
}
format(tString,sizeof(tString), " %s", result);
SendClientMessageToAll(COLOR_GREEN, "----------------------------------------------------");
SendClientMessageToAll(COLOR_YELLOW,tString);
SendClientMessageToAll(COLOR_GREEN, "----------------------------------------------------");
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "Admin %s has used /chatannounce command", pName);
SendClientMessageToAdmins(COLOR_WHITE, string);
return 1;
}
}
all when i got that its say 4ERROR:
C:\Documents and Settings\Administrateur\Bureau\httppastebin.combp6 ZSP7A\gamemodes\ZZZZ.pwn(220) : warning 201: redefinition of constant/macro (symbol "SLOTS")
C:\Documents and Settings\Administrateur\Bureau\httppastebin.combp6 ZSP7A\gamemodes\ZZZZ.pwn(1383) : error 017: undefined symbol "string"
C:\Documents and Settings\Administrateur\Bureau\httppastebin.combp6 ZSP7A\gamemodes\ZZZZ.pwn(1383) : error 017: undefined symbol "string"
C:\Documents and Settings\Administrateur\Bureau\httppastebin.combp6 ZSP7A\gamemodes\ZZZZ.pwn(1383) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrateur\Bureau\httppastebin.combp6 ZSP7A\gamemodes\ZZZZ.pwn(1383) : 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: String ERROR -
BMUK - 26.11.2010
Put that in your command, or in the command callback.
Re: String ERROR -
MadeMan - 26.11.2010
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[128];
Add string on top of OnPlayerCommandText.
Re: String ERROR -
AzTeCaS - 26.11.2010
another ERROR: error 017: undefined symbol "tString"
Re: String ERROR -
Kitten - 26.11.2010
Lol