/rc chat 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)
+--- Thread: /rc chat help (
/showthread.php?tid=469079)
/rc chat help -
efrim123 - 11.10.2013
Hello
i made a commands for regular players only and i get this error when i already forward it
this is the code itself
pawn Код:
CMD:rc(playerid,params[])
{
new string[128];
if(GetPVarInt(playerid, "Spawned") != 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
return 1;
}
if(pInfo[playerid][Regularlevel] != 1);
{
SendClientMessage(playerid,COLOR_ERROR,"Only Regular Players can use the Regular Player chat to talk.");
return 1;
}
if(!strlen(params))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /rc (Message)");
return 1;
}
format(string,sizeof(string),"[REGULAR CHAT] %s(%d): %s",GetName(playerid),playerid,params);
SendClientMessageToAllRegulars(string);
return 1;
}
Here is the error:
Код:
C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(1185) : error 036: empty statement
C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(1190) : warning 225: unreachable code
C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(1196) : error 017: undefined symbol "SendClientMessageToAllRegulars"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
Re: /rc chat help -
SilentSoul - 11.10.2013
pawn Код:
CMD:rc(playerid,params[])
{
new string[128];
if(GetPVarInt(playerid, "Spawned") != 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
return 1;
}
if(pInfo[playerid][Regularlevel] != 1);
{
SendClientMessage(playerid,COLOR_ERROR,"Only Regular Players can use the Regular Player chat to talk.");
return 1;
}
if(!strlen(params))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /rc (Message)");
return 1;
}
format(string,sizeof(string),"[REGULAR CHAT] %s(%d): %s",GetPlayerNameEx(playerid),playerid,params);
SendClientMessageToAllRegularsl(string);
return 1;
}
And make stock for SendClientMessageToallregulars
EDIT : Scroll down to Emmet_ comment.
Re: /rc chat help - Emmet_ - 11.10.2013
pawn Код:
CMD:rc(playerid,params[])
{
new string[128];
if(GetPVarInt(playerid, "Spawned") != 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
return 1;
}
if(pInfo[playerid][Regularlevel] != 1)
{
SendClientMessage(playerid,COLOR_ERROR,"Only Regular Players can use the Regular Player chat to talk.");
return 1;
}
if(!strlen(params))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /rc (Message)");
return 1;
}
format(string,sizeof(string),"[REGULAR CHAT] %s(%d): %s",GetName(playerid),playerid,params);
SendClientMessageToAllRegulars(string);
return 1;
}
stock SendClientMessageToAllRegulars(const str[])
{
for (new i = 0, j = GetMaxPlayers(); i < j; i ++) if (IsPlayerConnected(i))
{
if (pInfo[i][Regularlevel] != 0)
{
SendClientMessage(i, 0x00FF00FF, str);
}
}
return 1;
}
Re: /rc chat help -
efrim123 - 11.10.2013
The command role is to give only regular players the message not for players
i forward it like i did
pawn Код:
forward SendClientMessageToAllRegulars(msg[]);
NVM Thanks emmet