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(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
PHP код:
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