CMD:accent(playerid, params[])
{
if(strlen(cmdtext) < 9)
return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE /accent [Accent]");
new string[60];
SetPVarString(playerid, "Accent", cmdtext[8]);
format(string, 60, "You have set your accent to %s.", cmdtext[8]);
SendClientMessage(playerid, 0x33CCFFAA, string);
return 1;
}
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2684) : warning 217: loose indentation C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2866) : error 017: undefined symbol "cmdtext" C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2869) : error 017: undefined symbol "cmdtext" C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2869) : warning 215: expression has no effect C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2869) : error 001: expected token: ";", but found "]" C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2869) : error 029: invalid expression, assumed zero C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2869) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
CMD:accent(playerid, params[])
{
new accent[50];
if(sscanf(params, "s[50]", accent)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /accent [accent]");
if(strlen(accent) < 9 || strlen(accent) > 50) return SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid accent length. It has to be greater than 9 and less than 50 characters.");
SetPVarString(playerid, "Accent", accent);
new string[128];
format(string, sizeof(string), "You have set your accent to: %s.", accent);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
CMD:setmessage(playerid,params[]) { new Message[128], string[128]; if(sscanf(params,"s[128]", Message)) return SendClientMessage(playerid, -1, "Usage: /setmessage [custom_message]"); format(string, sizeof(string), "You have set your Join Message to: %s", Message); SendClientMessage(playerid, -1, string); format(PlayerInfo[playerid][personalmsg], 128, "%s", Message); return 1; }
Hey guys im trying to make a command but dont work for me its the /accent [accent] [text] , i want save it on the enum pAccent
I got this: PHP код:
Код:
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2684) : warning 217: loose indentation C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2866) : error 017: undefined symbol "cmdtext" C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2869) : error 017: undefined symbol "cmdtext" C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2869) : warning 215: expression has no effect C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2869) : error 001: expected token: ";", but found "]" C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2869) : error 029: invalid expression, assumed zero C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2869) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors. |
Untested but should work. Study the code.
PHP код:
|
public OnPlayerText(playerid, text[]) { if (realchat) { new string[128]; format(string, sizeof(string), "%s says: %s", GetName(playerid), text); ProxDetector(30.0, playerid, string,COLOR_CORRECTION,COLOR_CORRECTION,COLOR_CORRECTION,COLOR_CORRECTION,COLOR_CORRECTION); format(string, sizeof(string), "says: %s", text); SetPlayerChatBubble(playerid,string,COLOR_YELLOW,5.0,5000); ApplyAnimation(playerid,"PED","IDLE_CHAT",2.0,1,0,0,1,1); return 0; } IdleTime[playerid] = 0; return 1; }
public OnPlayerText(playerid, text[])
{
if(realchat)
{
new string[128], accent[50];
strmid(accent, GetPVarString(playerid, "Accent"); , 0, 50, 50);
if(strlen(accent))
format(string, sizeof(string), "[%s] %s says: %s", accent, GetName(playerid), text);
else
format(string, sizeof(string), "%s says: %s", GetName(playerid), text);
ProxDetector(30.0, playerid, string,COLOR_CORRECTION,COLOR_CORRECTION,COLOR_CORRECTION,COLOR_CORRECTION,COLOR_CORRECTION);
format(string, sizeof(string), "says: %s", text);
SetPlayerChatBubble(playerid,string,COLOR_YELLOW,5.0,5000);
ApplyAnimation(playerid,"PED","IDLE_CHAT",2.0,1,0,0,1,1);
return 0;
}
IdleTime[playerid] = 0;
return 1;
}
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : warning 202: number of arguments does not match definition C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : warning 202: number of arguments does not match definition C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : error 035: argument type mismatch (argument 2) C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : error 029: invalid expression, assumed zero C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : warning 215: expression has no effect C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : warning 215: expression has no effect C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : warning 215: expression has no effect C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : error 001: expected token: ";", but found ")" C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
strmid(accent, GetPVarString(playerid, "Accent"); , 0, 50, 50);
what is this?
Код:
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : warning 202: number of arguments does not match definition C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : warning 202: number of arguments does not match definition C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : error 035: argument type mismatch (argument 2) C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : error 029: invalid expression, assumed zero C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : warning 215: expression has no effect C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : warning 215: expression has no effect C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : warning 215: expression has no effect C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : error 001: expected token: ";", but found ")" C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. PHP код:
|
strmid(accent, GetPVarString(playerid, "Accent"); , 0, 50, 50);
strmid(accent, GetPVarString(playerid, "Accent"), 0, 50, 50);
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : warning 202: number of arguments does not match definition C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : warning 202: number of arguments does not match definition C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : error 035: argument type mismatch (argument 2) C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2690) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
strmid(accent, GetPVarString(playerid, "Accent"), 0, 50, 50);
Код:
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : warning 202: number of arguments does not match definition C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : warning 202: number of arguments does not match definition C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1103) : error 035: argument type mismatch (argument 2) C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2690) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error. PHP код:
|
CMD:accent( playerid, cmdtext[] )
{
if(strlen( cmdtext ) < 9 )
{
SendClientMessage( playerid, 0xFFFFFFFF, "USAGE: /accent [text]" );
return 1;
}
new
szString[ 120 ];
SetPVarString( playerid, "Accent", cmdtext );
format( szString, sizeof( szString ), "You have set your accent to %s.", cmdtext );
SendClientMessage( playerid, 0x33CCFFAA, szString );
return 1;
}
public OnPlayerText( playerid, text[] )
{
new szText[ 128 ];
if( realchat )
{
new szAccent[ 60 ];
GetPVarString( playerid, "Accent", szAccent, sizeof( szAccent ) );
if( !isnull( szAccent ) ) {
format( szText, sizeof( szText ), "[%s] %s says: %s", szAccent, GetName( playerid ), text );
} else {
format( szText, sizeof( szText ), "%s says: %s", GetName( playerid ), text );
}
ProxDetector( 30.0, playerid, szText ,COLOR_CORRECTION,COLOR_CORRECTION,COLOR_CORRECTION,COLOR_CORRECTION,COLOR_CORRECTION );
format( szText, sizeof( szText ), "says: %s", text );
SetPlayerChatBubble( playerid, szText, COLOR_YELLOW, 5.0, 5000 );
ApplyAnimation(playerid,"PED","IDLE_CHAT",2.0,1,0,0,1,1);
return 0;
}
IdleTime[ playerid ] = 0;
return 1;
}