30.07.2010, 17:14
I need a OOC (Out of Character, /o) command, Please help!
public OnPlayerText(playerid, text[])
{
if(text[0] == '$') //If the text starts with a '$', it'll send OOC.
{
new pName[MAX_PLAYER_NAME], string[128]; GetPlayerName(playerid, pName, sizeof pName);
format(string,sizeof string,"[OOC] %s: %s",pName, text[1]);
SendClientMessageToAll(0x0000ffff,string);
return 0;
}
return 1;
}
OOC: Out Of Character
pawn Код:
|
public OnPlayerCommandText(playerid, cmdtext[])
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext,"/ooc",true)) //If the text starts with a '$', it'll send OOC.
{
new pName[MAX_PLAYER_NAME], string[128]; GetPlayerName(playerid, pName, sizeof pName);
format(string,sizeof string,"[OOC] %s: %s",pName, text[5]);
SendClientMessageToAll(0x0000ffff,string);
return 1;
}
return 0;
}
pawn Код:
|
format(string,sizeof string,"[OOC]%s: %s",pName, text[5]);
C:\Users\BooNii3\Geramia RP\LV-RP\gamemodes\New!.pwn(159) : error 017: undefined symbol "text" C:\Users\BooNii3\Geramia RP\LV-RP\gamemodes\New!.pwn(159) : warning 215: expression has no effect C:\Users\BooNii3\Geramia RP\LV-RP\gamemodes\New!.pwn(159) : error 001: expected token: ";", but found "]" C:\Users\BooNii3\Geramia RP\LV-RP\gamemodes\New!.pwn(159) : error 029: invalid expression, assumed zero
if (strcmp("/ooc", cmdtext, true) == 0)
{
new string[128];
new pName[MAX_PLAYER_NAME], string[128]; GetPlayerName(playerid, pName, sizeof pName);
format(string,sizeof string,"[OOC] %s: %s",pName, string);
SendClientMessageToAll(0x0000ffff,string);
return 1;
}