SA-MP Forums Archive
Command crashes the server - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command crashes the server (/showthread.php?tid=637317)



Command crashes the server - Eoussama - 12.07.2017

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

PHP код:
CMD:viptoys(playerid){
    
    if(!
IsPlayerVIP(playerid)) return SendClientMessage(playeridVIPCOLOR_RED"[ERROR]: You are not a VIP, you cannot use this command!");
    new 
_content[300], _state[16];
    for(new 
ii<MAX_PLAYER_ATTACHED_OBJECTSi++){
        
format(_contentsizeof(_content), "%s%s\t%s" ,_contentgPlayerBone[i], _state);
        
_state IsPlayerAttachedObjectSlotUsed(playeridi) ? (""VIPCOL_RED"[USED]") : (""VIPCOL_GREEN"[EMPTY]");
    }
    
ShowPlayerDialog(playeridDIALOG_TOYSINDEXDIALOG_STYLE_LIST"VIP Attachments"_content"Select""Cancel");
    return 
1;

Version 2

PHP код:
CMD:viptoys(playerid){
    
    if(!
IsPlayerVIP(playerid)) return SendClientMessage(playeridVIPCOLOR_RED"[ERROR]: You are not a VIP, you cannot use this command!");
    new 
_content[300];
    for(new 
ii<MAX_PLAYER_ATTACHED_OBJECTSi++){
        
format(_contentsizeof(_content), "%s%s\t%s" ,_contentgPlayerBone[i], IsPlayerAttachedObjectSlotUsed(playeridi) ? (""VIPCOL_RED"[USED]") : (""VIPCOL_GREEN"[EMPTY]"));
    }
    
ShowPlayerDialog(playeridDIALOG_TOYSINDEXDIALOG_STYLE_LIST"VIP Attachments"_content"Select""Cancel");
    return 
1;

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