Posts: 311
Threads: 55
Joined: Dec 2009
My Command doesnt work ingame and no compile errors :O
pawn Код:
CMD:aooc(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new sendername[MAX_PLAYER_NAME], string[56];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(isnull(params)) return SendClientMessage(playerid, 0xFFFFFFF,"Syntax error.Correct usage: /ooc [text]");
format(string, sizeof(string), "{00FF00}(( {FFFFFF}%s: %s {00FF00}))", sendername, params);
SendClientMessageToAll(0xFFFFFFF, string);
}
else
{
SendClientMessage(playerid, 0xFF00FF, "[Admin] Sorry you are not a administrator!");
}
return 1;
}
Posts: 195
Threads: 14
Joined: Oct 2010
You want this to work when your logged into the RCON?
Posts: 311
Threads: 55
Joined: Dec 2009
Quote:
Originally Posted by Cjgogo
pawn Код:
CMD:aooc(playerid, params[]) { if(IsPlayerAdmin(playerid)) { new sendername[MAX_PLAYER_NAME], string[56]; GetPlayerName(playerid, sendername, sizeof(sendername)); if(sscanf(params,"s[56]",string)) return SendClientMessage(playerid, 0xFFFFFFF,"Syntax error.Correct usage: /ooc [text]"); format(string, sizeof(string), "{00FF00}(( {FFFFFF}%s: %s {00FF00}))", sendername, params); SendClientMessageToAll(0xFFFFFFF, string); } else SendClientMessage(playerid, 0xFF00FF, "[Admin] Sorry you are not a administrator!"); return 1; }
Try it like that.
|
I'll try, I am trying to make a freeroam script.
Any tutorials on making factions + a request cmd to requst to join a faction?
EDIT: It wont say my text
EDIT2: I'l try again, I didnt add sscanf plugin XDD
EDIT3: Didnt work, doesn't say my text
Posts: 1,223
Threads: 5
Joined: Sep 2011
Reputation:
0
change the string size to 128 (56 is really small, you're already using 47 by the time you get to the players text)
also...You don't need sscanf for this, you can use what you already had.
Posts: 311
Threads: 55
Joined: Dec 2009
Quote:
Originally Posted by [ABK]Antonio
change the string size to 128 (56 is really small, you're already using 47 by the time you get to the players text)
also...You don't need sscanf for this, you can use what you already had.
|
It won't work just syas Syntyax error all the time when /aooc test
Posts: 311
Threads: 55
Joined: Dec 2009
Quote:
Originally Posted by Cjgogo
pawn Код:
CMD:aooc(playerid, params[]) { if(IsPlayerAdmin(playerid)) { new sendername[MAX_PLAYER_NAME], string[512],message[256]; GetPlayerName(playerid, sendername, sizeof(sendername)); if(sscanf(params,"s[256]",message)) return SendClientMessage(playerid, 0xFFFFFFF,"Syntax error.Correct usage: /ooc [text]"); format(string, sizeof(string), "{00FF00}(( {FFFFFF}%s: %s {00FF00}))", sendername, message); SendClientMessageToAll(0xFFFFFFF, string); } else SendClientMessage(playerid, 0xFF00FF, "[Admin] Sorry you are not a administrator!"); return 1; }
Try it like that,you had no string defined for the message you were about to send
|
nope,
Why can no-one fix this xD