if(strcmp(cmd, "/accent", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Usage: /accent <accent> (German, Spanish, American, Irish, Italian)");
return 1;
{ // This is line 28396
new accent[128];
accent = PlayerInfo[playerid][pAccent]);
{
switch(PlayerInfo[playerid][pAccent])
{
case 1: accent = "American";
{
PlayerInfo[playerid][pAccent] = accent;
format(string, sizeof(string), "Accent changed to %d", accent);
SendClientMessage(playerid, COLOR_GREY, string);
}
case 2: accent = "Irish"; // This is line 28408
{
PlayerInfo[playerid][pAccent] = accent;
format(string, sizeof(string), "Accent changed to %d", accent);
SendClientMessage(playerid, COLOR_GREY, string);
}
case 3: accent = "Spanish";
{
PlayerInfo[playerid][pAccent] = accent;
format(string, sizeof(string), "Accent changed to %d", accent);
SendClientMessage(playerid, COLOR_GREY, string);
}
case 4: accent = "German";
{
PlayerInfo[playerid][pAccent] = accent;
format(string, sizeof(string), "Accent changed to %d", accent);
SendClientMessage(playerid, COLOR_GREY, string);
}
case 5: accent = "Italian";
{
PlayerInfo[playerid][pAccent] = accent;
format(string, sizeof(string), "Accent changed to %d", accent);
SendClientMessage(playerid, COLOR_GREY, string);
}
default:
{
format(string, sizeof(string), "Invalid Accent", accent);
SendClientMessage(playerid, COLOR_GREY, string);
}
}
}
}
return 1;
}
D:\Sa-mp\Random Scripts\Mania-RP\gamemodes\Mania-RP.pwn(28396) : warning 225: unreachable code D:\Sa-mp\Random Scripts\Mania-RP\gamemodes\Mania-RP.pwn(28398) : error 047: array sizes do not match, or destination array is too small D:\Sa-mp\Random Scripts\Mania-RP\gamemodes\Mania-RP.pwn(28398) : error 029: invalid expression, assumed zero D:\Sa-mp\Random Scripts\Mania-RP\gamemodes\Mania-RP.pwn(28398) : warning 215: expression has no effect D:\Sa-mp\Random Scripts\Mania-RP\gamemodes\Mania-RP.pwn(28403) : error 002: only a single statement (or expression) can follow each "case" D:\Sa-mp\Random Scripts\Mania-RP\gamemodes\Mania-RP.pwn(28404) : error 006: must be assigned to an array D:\Sa-mp\Random Scripts\Mania-RP\gamemodes\Mania-RP.pwn(28408) : error 014: invalid statement; not in switch D:\Sa-mp\Random Scripts\Mania-RP\gamemodes\Mania-RP.pwn(28408) : warning 215: expression has no effect D:\Sa-mp\Random Scripts\Mania-RP\gamemodes\Mania-RP.pwn(28408) : error 001: expected token: ";", but found ":" D:\Sa-mp\Random Scripts\Mania-RP\gamemodes\Mania-RP.pwn(28408) : error 029: invalid expression, assumed zero D:\Sa-mp\Random Scripts\Mania-RP\gamemodes\Mania-RP.pwn(28408) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 8 Errors.
if(strcmp(cmd, "/accent", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Usage: /accent <accent> (German, Spanish, American, Irish, Italian)");
return 1;
} // This is line 28396
switch(tmp)
{
case American,Irish,Spanish,German,Italian:
{
format(PlayerInfo[playerid][pAccent],sizeof(accent),"%s",tmp);
format(string, sizeof(string), "Accent changed to %s",PlayerInfo[playerid][pAccent]);
SendClientMessage(playerid, COLOR_GREY, string);
}
default:
{
format(string, sizeof(string), "Invalid Accent", accent);
SendClientMessage(playerid, COLOR_GREY, string);
}
}
}
}
return 1;
}
pawn Код:
|
if(strcmp(cmd, "/accent", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Usage: /accent <accent> (German, Spanish, American, Irish, Italian)");
return 1;
} // This is line 28396
switch(tmp)
{
case American,Irish,Spanish,German,Italian:
{
format(PlayerInfo[playerid][pAccent],sizeof(accent),"%s",tmp);
format(string, sizeof(string), "Accent changed to %s",PlayerInfo[playerid][pAccent]);
SendClientMessage(playerid, COLOR_GREY, string);
}
default:
{
format(string, sizeof(string), "Invalid Accent", accent);
SendClientMessage(playerid, COLOR_GREY, string);
}
}
}
return 1;
}
if ( !strcmp( cmd, "/accent", true ) && IsPlayerConnected( playerid ) )
{
tmp = strtok( cmdtext, idx );
if ( !strlen( tmp ) )
{
SendClientMessage( playerid, -1, "SYNTAX: /accent < accentname" )
SendClientMessage( playerid, -1, "Available accents: German, Spanish, American, Irish, Italian" );
return -1;
}
static
validAccents[ ][ ] = { "German", "Spanish", "American", "Irish", "Italian" };
for ( new j = sizeof validAccents, i; i < j; i ++ )
{
if ( !strcmp( tmp, validAccents[ i ], true ) )
{
PlayerInfo[ playerid ][ pAccent ] = tmp;
static
szStr[ 128 ]
;
format( szStr, sizeof szStr, "Accent changed to : %s", tmp );
SendClientMessage( playerid, -1, szStr );
}
else
return SendClientMessage( playerid, -1, "Invalid accent." );
}
return 1;
}
Try this
pawn Код:
|
error 006: must be assigned to an array
PlayerInfo[ playerid ][ pAccent ] = strval( tmp );