PDA

View Full Version : Command crashes the server


Eoussama
12/07/2017, 07:10 PM
Hello there hope you're having a nice day,
so I made this command that displays a dialog with Used/un-Used Player object slots, but whenever I try to execute it, the server crashes

I made the command in 2 versions, but they both cause the crash to occur,

Version 1


CMD:viptoys(playerid){

if(!IsPlayerVIP(playerid)) return SendClientMessage(playerid, VIPCOLOR_RED, "[ERROR]: You are not a VIP, you cannot use this command!");
new _content[300], _state[16];

for(new i; i<MAX_PLAYER_ATTACHED_OBJECTS; i++){
format(_content, sizeof(_content), "%s%s\t%s" ,_content, gPlayerBone[i], _state);
_state = IsPlayerAttachedObjectSlotUsed(playerid, i) ? (""VIPCOL_RED"[USED]") : (""VIPCOL_GREEN"[EMPTY]");
}

ShowPlayerDialog(playerid, DIALOG_TOYSINDEX, DIALOG_STYLE_LIST, "VIP Attachments", _content, "Select", "Cancel");

return 1;
}


Version 2


CMD:viptoys(playerid){

if(!IsPlayerVIP(playerid)) return SendClientMessage(playerid, VIPCOLOR_RED, "[ERROR]: You are not a VIP, you cannot use this command!");
new _content[300];

for(new i; i<MAX_PLAYER_ATTACHED_OBJECTS; i++){
format(_content, sizeof(_content), "%s%s\t%s" ,_content, gPlayerBone[i], IsPlayerAttachedObjectSlotUsed(playerid, i) ? (""VIPCOL_RED"[USED]") : (""VIPCOL_GREEN"[EMPTY]"));
}

ShowPlayerDialog(playerid, DIALOG_TOYSINDEX, DIALOG_STYLE_LIST, "VIP Attachments", _content, "Select", "Cancel");

return 1;
}


NOTE : NVM, fixed, I just added a /n