16.08.2012, 18:48
Time doesn't require a destination size since an integer is required. How can I fix this?
EDIT: I'm also getting this...
pawn Код:
YCMD:cage(playerid, params[], help)
{
if( PlayerInfo[playerid][pAdmin] > 2 )
{
new
TargetID,
time,
tReason[50];
if( !sscanf(params, "uiS(No reason specified)[50]", TargetID, time, tReason) )
{
if( strlen( tReason ) > 50 ) return SendClientMessage( playerid, -1, "SERVER: Maximum reason size: 50" );
if( !IsPlayerConnected(TargetID) ) return SendClientMessage( playerid, -1, "SERVER: Invalid playerid! Please try again" );
if( time < 10 ) return SendClientMessage( playerid, -1, "SERVER: Minimum time required: 10" );
if( PlayerInfo[TargetID][pCaged] == 1 ) return SendClientMessage( playerid, -1, "SERVER: Player is already in the cage!" );
new MyString[128],
TargetString[128],
Float:Pos[3];
format( MyString, sizeof MyString, "SERVER: Caged %s (ID: %i) with the reason: %s (Caged: %d seconds)", GetName(TargetID), TargetID, tReason, time );
format( TargetString, sizeof TargetString, "SERVER: %s (ID: %i) has been Caged by %s (ID: %i) with the reason: %s (Caged: %d seconds)", GetName(TargetID), TargetID, GetName(playerid), playerid, tReason, time );
SendClientMessageToAll( -1, TargetString );
SendClientMessage( playerid, -1, MyString );
TogglePlayerControllable(TargetID, 0);
PlayerInfo[TargetID][pCageTime] = time;
PlayerInfo[TargetID][pCaged] = 1;
GetPlayerPos(TargetID, Pos[0], Pos[1], Pos[2]);
SetTimerEx("CagePlayer", 1000, 0, "i", TargetID);
SetTimerEx("UnCagePlayer", PlayerInfo[TargetID][pCageTime]*1000, 0, "i", TargetID);
}
else
return SendClientMessage(playerid, -1, "SERVER: /cage [targetid] [time] [reason]");
}
else
return SendClientMessage( playerid, -1, "SERVER: You have to be an admin to perform this command!" );
return 1;
}
Код:
sscanf warning: Unknown format specifier '[', skipping sscanf warning: Unknown format specifier '3', skipping sscanf warning: Unknown format specifier ']', skipping sscanf warning: Unknown format specifier '[', skipping sscanf warning: Unknown format specifier '3', skipping sscanf warning: Unknown format specifier ']', skipping sscanf warning: Unknown format specifier '[', skipping sscanf warning: Unknown format specifier '3', skipping sscanf warning: Unknown format specifier ']', skipping sscanf warning: Unknown format specifier '[', skipping sscanf warning: Unknown format specifier '3', skipping sscanf warning: Unknown format specifier ']', skipping