Need URGENT HELP! /say not working properly - 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: Need URGENT HELP! /say not working properly (
/showthread.php?tid=99248)
Need URGENT HELP! /say not working properly -
Striker_Moe - 26.09.2009
Код:
if(strcmp(cmd, "/say", true) == 0) // Publicly says an admin message.
{
if (AccountInfo[playerid][AdminLevel] = 2)
{
new playername[MAX_PLAYER_NAME];
new result[128];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "{:: Trial Admin %s: %s ::}", playername, result);
SendClientMessageToAll(ADMIN_RED, string);
}
if (AccountInfo[playerid][AdminLevel] = 3)
{
new playername[MAX_PLAYER_NAME];
new result[128];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "{:: Admin %s: %s ::}", playername, result);
SendClientMessageToAll(ADMIN_RED, string);
}
if (AccountInfo[playerid][AdminLevel] = 4)
{
new playername[MAX_PLAYER_NAME];
new result[128];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "{:: High Admin %s: %s ::}", playername, result);
SendClientMessageToAll(ADMIN_RED, string);
}
if (AccountInfo[playerid][AdminLevel] = 5)
{
new result[128];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "{:: Lead Admin %s: %s ::}", playername, result);
SendClientMessageToAll(ADMIN_RED, string);
}
else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
return 1;
}
Hereґs my new code, but If i use /say TEXT, all 4 messages show up (Trial, Admin, High, Lead) and no text is displayed. Why?
Re: Need URGENT HELP! /say not working properly -
Striker_Moe - 26.09.2009
Aight nevermind, got it
Код:
if(strcmp(cmd, "/say", true) == 0) // Publicly says an admin message.
{
new result[264];
result = strtok(cmdtext, idx);
if (AccountInfo[playerid][AdminLevel] < 3)
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "{:: Trial Admin %s: %s ::}", playername, result);
SendClientMessageToAll(ORANGE, string);
return 1;
}
else if (AccountInfo[playerid][AdminLevel] < 4)
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "{:: Admin %s: %s ::}", playername, result);
SendClientMessageToAll(ORANGE, string);
return 1;
}
else if (AccountInfo[playerid][AdminLevel] < 5)
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "{:: High Admin %s: %s ::}", playername, result);
SendClientMessageToAll(ORANGE, string);
return 1;
}
else if (AccountInfo[playerid][AdminLevel] < 6)
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "{:: Lead Admin %s: %s ::}", playername, result);
SendClientMessageToAll(ORANGE, string);
return 1;
}
return 0;
}
But why is the text entered only displayed partly?
Re: Need URGENT HELP! /say not working properly -
Striker_Moe - 26.09.2009
Anyone?