sscanf warning: Format specifier does not match parameter count.
new id, secid;
if(sscanf(params, "dd", id))//missing one parameter..
CMD:pm(playerid, params[])
{
new str[128], str2[128], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
if(sscanf(params, "us", id, str2))
{
SendClientMessage(playerid, COLOR_YELLOW, "Usage: /pm <id> <message>");
return 1;
}
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_YELLOW, "ERROR: Player not connected");
if(BlockPM[playerid] == id) return SendClientMessage(playerid, COLOR_YELLOW, "ERROR: You cannot pm this player because he has blocked you from doing so.");
if(GetPVarInt(id,"NoPM") == 1) return SendClientMessage(playerid, COLOR_GREY,"ERROR: That player has disabled Private Messages.");
if(playerid == id) return SendClientMessage(playerid, COLOR_YELLOW, "ERROR: You cannot pm yourself!");
{
GetPlayerName(playerid, Name1, sizeof(Name1));
GetPlayerName(id, Name2, sizeof(Name2));
sscanf(params, "ds[128]", id, str2);
format(str, sizeof(str), "(( PM To %s(ID %d): %s ))", Name2, id, str2);
SendClientMessage(playerid, COLOR_YELLOW, str);
sscanf(params, "ds[128]", id, str2);
format(str, sizeof(str), "(( PM From %s(ID %d): %s ))", Name1, playerid, str2);
SendClientMessage(id, COLOR_YELLOW, str);
}
return 1;
}
CMD:pm(playerid, params[])
{
new str[128], str2[128], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
if(sscanf(params, "us[128]", id, str2))
{
SendClientMessage(playerid, COLOR_YELLOW, "Usage: /pm <id> <message>");
return 1;
}
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_YELLOW, "ERROR: Player not connected");
if(BlockPM[playerid] == id) return SendClientMessage(playerid, COLOR_YELLOW, "ERROR: You cannot pm this player because he has blocked you from doing so.");
if(GetPVarInt(id,"NoPM") == 1) return SendClientMessage(playerid, COLOR_GREY,"ERROR: That player has disabled Private Messages.");
if(playerid == id) return SendClientMessage(playerid, COLOR_YELLOW, "ERROR: You cannot pm yourself!");
{
GetPlayerName(playerid, Name1, sizeof(Name1));
GetPlayerName(id, Name2, sizeof(Name2));
sscanf(params, "ds[128]", id, str2);
format(str, sizeof(str), "(( PM To %s(ID %d): %s ))", Name2, id, str2);
SendClientMessage(playerid, COLOR_YELLOW, str);
sscanf(params, "ds[128]", id, str2);
format(str, sizeof(str), "(( PM From %s(ID %d): %s ))", Name1, playerid, str2);
SendClientMessage(id, COLOR_YELLOW, str);
}
return 1;
}
pawn Код:
|
Can it be this one?
pawn Код:
|
CMD:pm(playerid, params[])
{
new id, msg[128];
if(sscanf(params, "us[128]", id, msg))return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /pm <id> <message>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_YELLOW, "ERROR: Player not connected");
if(BlockPM[playerid] == id) return SendClientMessage(playerid, COLOR_YELLOW, "ERROR: You cannot pm this player because he has blocked you from doing so.");
if(GetPVarInt(id,"NoPM") == 1) return SendClientMessage(playerid, COLOR_GREY,"ERROR: That player has disabled Private Messages.");
if(playerid == id) return SendClientMessage(playerid, COLOR_YELLOW, "ERROR: You cannot pm yourself!");
new str[128], Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name1, sizeof(Name1));
GetPlayerName(id, Name2, sizeof(Name2));
format(str, sizeof(str), "(( PM To %s(ID %d): %s ))", Name2, id, msg), SendClientMessage(playerid, COLOR_YELLOW, str);
format(str, sizeof(str), "(( PM From %s(ID %d): %s ))", Name1, playerid, msg), SendClientMessage(id, COLOR_YELLOW, str);
return 1;
}
[17:08:12] [debug] Run time error 4: "Array index out of bounds" [17:08:12] [debug] Accessing element at index 598 past array upper bound 499 [17:08:12] [debug] AMX backtrace: [17:08:12] [debug] #0 0045c7d4 in public OnVehicleSpawn (598) from SFRP.amx [17:08:12] [debug] #1 native SetVehicleToRespawn () from samp-server.exe [17:08:12] [debug] #2 001b3ac8 in public Audio_OnGameModeInit () from SFRP.amx [17:08:12] [debug] #3 native CallLocalFunction () from samp-server.exe [17:08:12] [debug] #4 00011174 in public SSCANF_OnGameModeInit () from SFRP.amx [17:08:12] [debug] #5 0000b31c in public zcmd_OnGameModeInit () from SFRP.amx [17:08:12] [debug] #6 native CallLocalFunction () from samp-server.exe [17:08:12] [debug] #7 0000add8 in public Timers_OnScriptInit () from SFRP.amx [17:08:12] [debug] #8 native CallLocalFunction () from samp-server.exe [17:08:12] [debug] #9 0000ac60 in public YVers_OnScriptInit () from SFRP.amx [17:08:12] [debug] #10 native CallLocalFunction () from samp-server.exe [17:08:12] [debug] #11 00009980 in public Itter_OnGameModeInit () from SFRP.amx [17:08:12] [debug] #12 native CallLocalFunction () from samp-server.exe [17:08:12] [debug] #13 00000ef4 in public OnGameModeInit () from SFRP.amx [17:08:12] [debug] Run time error 4: "Array index out of bounds" [17:08:12] [debug] Accessing element at index 599 past array upper bound 499 [17:08:12] [debug] AMX backtrace: [17:08:12] [debug] #0 0045c7d4 in public OnVehicleSpawn (599) from SFRP.amx [17:08:12] [debug] #1 native SetVehicleToRespawn () from samp-server.exe [17:08:12] [debug] #2 001b3afc in public Audio_OnGameModeInit () from SFRP.amx [17:08:12] [debug] #3 native CallLocalFunction () from samp-server.exe [17:08:12] [debug] #4 00011174 in public SSCANF_OnGameModeInit () from SFRP.amx [17:08:12] [debug] #5 0000b31c in public zcmd_OnGameModeInit () from SFRP.amx [17:08:12] [debug] #6 native CallLocalFunction () from samp-server.exe [17:08:12] [debug] #7 0000add8 in public Timers_OnScriptInit () from SFRP.amx [17:08:12] [debug] #8 native CallLocalFunction () from samp-server.exe [17:08:12] [debug] #9 0000ac60 in public YVers_OnScriptInit () from SFRP.amx [17:08:12] [debug] #10 native CallLocalFunction () from samp-server.exe [17:08:12] [debug] #11 00009980 in public Itter_OnGameModeInit () from SFRP.amx [17:08:12] [debug] #12 native CallLocalFunction () from samp-server.exe [17:08:12] [debug] #13 00000ef4 in public OnGameModeInit () from SFRP.amx [17:08:12] [debug] Run time error 4: "Array index out of bounds" [17:08:12] [debug] Accessing element at index 600 past array upper bound 499 [17:08:12] [debug] AMX backtrace: [17:08:12] [debug] #0 0045c7d4 in public OnVehicleSpawn (600) from SFRP.amx [17:08:12] [debug] #1 native SetVehicleToRespawn () from samp-server.exe [17:08:12] [debug] #2 001b3b30 in public Audio_OnGameModeInit () from SFRP.amx [17:08:12] [debug] #3 native CallLocalFunction () from samp-server.exe [17:08:12] [debug] #4 00011174 in public SSCANF_OnGameModeInit () from SFRP.amx [17:08:12] [debug] #5 0000b31c in public zcmd_OnGameModeInit () from SFRP.amx [17:08:12] [debug] #6 native CallLocalFunction () from samp-server.exe [17:08:12] [debug] #7 0000add8 in public Timers_OnScriptInit () from SFRP.amx [17:08:12] [debug] #8 native CallLocalFunction () from samp-server.exe [17:08:12] [debug] #9 0000ac60 in public YVers_OnScriptInit () from SFRP.amx [17:08:12] [debug] #10 native CallLocalFunction () from samp-server.exe [17:08:12] [debug] #11 00009980 in public Itter_OnGameModeInit () from SFRP.amx [17:08:12] [debug] #12 native CallLocalFunction () from samp-server.exe [17:08:12] [debug] #13 00000ef4 in public OnGameModeInit () from SFRP.amx