16.06.2014, 08:20
Server crashed when I use this command. I checked everything, the path, strings commands ... nothing works. Even if I type /maketeam it crashed.
Код:
COMMAND:maketeam(playerid, params[]) { if(PlayerInfo[playerid][power] > 1) { new iPlayer, iRank[64]; if( sscanf ( params, "us", iPlayer, iRank)) return SCP(playerid, "[PlayerID/PartOfName] [Group Name]"); if(!IsPlayerConnected(iPlayer)) return SendClientError(playerid, PLAYER_NOT_FOUND); new path[256]; format(path,sizeof(path),"/Teams/Team-%s.txt",PlayerInfo[iPlayer][playerteamname]); if(dini_Exists(path)) return SendClientError(playerid,"This player is already in a group!"); new hf[64]; format(hf,sizeof(hf),"/Teams/Team-%s.txt",iRank); if(!dini_Exists(hf)) { dini_Create(hf); dini_Set(hf,"teamname",iRank); dini_Set(hf,"owner",PlayerName(iPlayer)); myStrcpy(PlayerInfo[iPlayer][playerteamname],iRank); dUserSet(PlayerName(iPlayer)).("playerteamname",iRank); SendClientInfoEx(iPlayer,"Admin has given you the leader position of the group called %s.",iRank); SendClientInfoEx(playerid,"You have made %s the leader of the group %s.",PlayerName(iPlayer),iRank); PlayerInfo[iPlayer][teamtier]=0; return 1; } else { SendClientError(playerid,"This group name already exists!"); } return 1; } return 1; }