Downgrade this code please.. - 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: Downgrade this code please.. (
/showthread.php?tid=185308)
Downgrade this code please.. -
<Weponz> - 24.10.2010
Код:
if(!strcmp(cmdtext, "/tc", true, 3))
{
if(gTeam[playerid] == TEAM_TERRORISTS)
{
new output[255];
new pname[24];
new string[128];
if(!cmdtext[3])return SendClientMessage(playerid, RED, "USAGE: /tc [msg]");
GetPlayerName(playerid, pname, 24);
strmid(output,cmdtext,3,strlen(cmdtext));
format(string, sizeof(string), "TERRORIST-CHAT %s [%d] %s",pname,playerid,output);
printf("%s", string);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(gTeam[i] == TEAM_TERRORISTS)
{
format(string, sizeof(string), "(TEAM CHAT) %s [%d] %s",pname,playerid,output);
SendClientMessage(i, RED, string);
}
}
}
else
{
SendClientMessage(playerid, RED, "Only Terrorists Can Use This Command!");
}
return 1;
}
How can i combine as many of these as i like insted of making a whole new code for each team,Or do i simpley do under it
Код:
else if(gTeam[playerid] == TEAM_OTHER)//And so on
this will work right?
Re: Downgrade this code please.. -
Dreftas - 24.10.2010
Код:
if(!strcmp(cmdtext, "/tc", true, 3))
{
if(gTeam[playerid] == TEAM_TERRORISTS || gTeam[playerid] == TEAM_OTHER || gTeam[playerid] == TEAM_SOMETHING)
{
// rest of your code
Re: Downgrade this code please.. -
rbN. - 24.10.2010
try with ||
edit: im too late lol :P
Re: Downgrade this code please.. -
<Weponz> - 24.10.2010
oh yah! xDD *FACEPALM*
Thanks!!!