new motd[128];
motd = "|Server MOTD:: SA:MP 0.3 is here and it pwns.|"; SendClientMessage(playerid, COLOR_GREEN, motd);
if(strcmp(cmdtext, "/setmotd", true) == 0) { if(IsPlayerAdmin(playerid)) { if(!cmdtext[8])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /setmotd [message]"); motd = cmdtext[8]; return 1; } else { SendClientMessage(playerid,COLOR_RED,"You are not an RCON admin!"); } }
format(motd, sizeof(motd), "Blah");
format(motd, sizeof(motd), "Server MOTD:: SA:MP 0.3 is here and it pwns."); SendClientMessage(playerid, COLOR_GREEN, motd);
Originally Posted by SpiderPork
You have to use 'format' to change the motd variable:
pawn Код:
|
Originally Posted by Mo3
Well now Iґve got at OnPlayerConnect:
Код:
format(motd, sizeof(motd), "Server MOTD:: SA:MP 0.3 is here and it pwns."); SendClientMessage(playerid, COLOR_GREEN, motd); |
if(strcmp(cmdtext, "/setmotd", true) == 0) { if(IsPlayerAdmin(playerid)) { if(!cmdtext[8])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /setmotd [message]"); motd = cmdtext[8]; //HERE is the error line - same error as above. return 1; } else { SendClientMessage(playerid,COLOR_RED,"You are not an RCON admin!"); } }
strmid(motd,cmdtext[8],0,strlen(cmdtext[8]),128);
// Command
if(strcmp(cmdtext, "/setmotd", true) == 0)
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You are not an RCON admin!");
if(!cmdtext[8]) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /setmotd [message]");
format( motd, sizeof( motd ), "%s", cmdtext[8]);
return 1;
}
// OnPlayerConnect
new string[ 128 ];
format(string, sizeof(string), "Server MOTD:: %s", motd);
SendClientMessage(playerid, COLOR_GREEN, string);
Originally Posted by MenaceX^
He doesn't have to use format.
|
Originally Posted by SpiderPork
Quote:
|