30.04.2018, 05:26
Well again I have a problem, My gamemode has a problem with private messages, when you try to send a private message it sends it but it does not appear complete it always cuts part of the message and I do not know what to do and tried many things but I have no solution, that always happens to me when I add this include #include <sscanf> if I remove that include the / pm command works correctly but when I place it, the messages of some server functions come out shortened, with that include another command that I have and I put the include so that operate this command
This cmd work with sscanf include but without sscanf not work
This is the code of pm cmd
With the include sscanf the /searchcar works but without the sscanf it does not work but it works without problems the /pm, as it could work the 2 correctly...
that's why I put the issue of the pm command called '' error '' but I might have a solution to this problem
This cmd work with sscanf include but without sscanf not work
Код:
CMD:searchcar(playerid,params[]) { new idvp,ncar[600],StringSECH[1140],STRCCHAR[1140]; if(sscanf(params,"sT[600]",ncar))return SendClientMessage(playerid,red,"Use: /SearchCar [CarName]"); idvp = GetVehicleModelIDFromName(ncar); for(new i=0;i<MAX_VEHICLES;i++){ if(VehicleInfo[i][model] == idvp && VehicleInfo[i][Temp] == false){ format(StringSECH,sizeof(StringSECH),"{FFFAFA}Vehicle:{00FF00} %s | {FFFAFA}Owner:{00FF00} %s\n",VehicleName[GetVehicleModel(i)-400],VehicleInfo[i][owner],i); strcat(STRCCHAR,StringSECH);}} new dname[MAX_PLAYER_NAME]; new string[128]; format(string,sizeof(string),"17 %s ID(%d) Has Used Command /Searchcar",dname,playerid,params); IRC_GroupSay(groupID, IRC_ADMINCHANNEL, string); ShowPlayerDialog(playerid,601,DIALOG_STYLE_MSGBOX ,"{FFFF00}Search Car",STRCCHAR, "Ok", ""); return 1; }
Код:
CMD:pm(playerid,params[]) { if(PlayerInfo[playerid][Muted] == 1) { PlayerInfo[playerid][MuteWarnings]++; new string[128]; if(PlayerInfo[playerid][MuteWarnings] < ServerInfo[MaxMuteWarnings]) { format(string, sizeof(string),"WARNING: You are muted, if you continue to speak you will be kicked. (%d / %d)", PlayerInfo[playerid][MuteWarnings], ServerInfo[MaxMuteWarnings] ); SendClientMessage(playerid,red,string); } else { SendClientMessage(playerid,red,"You have been warned ! Now you have been kicked"); format(string, sizeof(string),"***%s (ID %d) was kicked for exceeding mute warnings", PlayerName2(playerid), playerid); SendClientMessageToAll(grey,string); SaveToFile("KickLog",string); Kick(playerid); } return 0; } new id, gMessage[128],Message[128],iName[MAX_PLAYER_NAME], pmName[MAX_PLAYER_NAME]; if (sscanf(params, "is",id,gMessage)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /pm <ID> <Message>"); if(!IsPlayerConnected(id)) { SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/pm : Bad player ID"); return 1; } if(playerid == id) { SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"You cannot PM yourself"); return 1; } if(ServerInfo[ReadPMs] == 1 && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) { new string[128],recievername[MAX_PLAYER_NAME],string2[128]; GetPlayerName(playerid, string, sizeof(string)); GetPlayerName(id, recievername, sizeof(recievername)); format(string, sizeof(string), "***[PM]: %s To %s: %s", string, recievername, gMessage); IRC_GroupSay(groupID, IRC_ADMINCHANNEL, string); for (new a = 0; a < MAX_PLAYERS; a++) if ((PlayerInfo[a][Level] >= ServerInfo[MaxAdminLevel]) && a != playerid) SendClientMessage(a, grey, string); } if(PlayerInfo[playerid][Muted] == 1) { new string[128]; PlayerInfo[playerid][MuteWarnings]++; if(PlayerInfo[playerid][MuteWarnings] < ServerInfo[MaxMuteWarnings]) { format(string, sizeof(string),"WARNING: You are muted, if you continue to speak you will be kicked (Warning: %d/%d)", PlayerInfo[playerid][MuteWarnings], ServerInfo[MaxMuteWarnings] ); SendClientMessage(playerid,red,string); } else { SendClientMessage(playerid,red,"You have been warned! Now you have been kicked"); GetPlayerName(playerid, string, sizeof(string)); format(string, sizeof(string),"%s [ID %d] Kicked for exceeding mute warnings", string, playerid); SendClientMessageToAll(grey,string); SaveToFile("KickLog",string); Kick(playerid); } return 0; } GetPlayerName(id,iName,sizeof(iName)); GetPlayerName(playerid,pmName,sizeof(pmName)); new tmp[128], tmp2[128], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); new player1 = strval(tmp); if(PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin"); format(Message,sizeof(Message),">> %s(%d): %s",iName,id,gMessage); SendClientMessage(playerid,PM_OUTGOING_COLOR,Message); format(Message,sizeof(Message),"** %s(%d): %s",pmName,playerid,gMessage); SendClientMessage(id,PM_INCOMING_COLOR,Message); PlayerPlaySound(id,1085,0.0,0.0,0.0); printf("PM: %s",Message); return 1; }
that's why I put the issue of the pm command called '' error '' but I might have a solution to this problem