18.09.2012, 17:22
Heey all,
How can i detect if a groupname alreay is choosen?
I made a command like creategroup:
How can i detect if a groupname already is choosen?
Admigo
How can i detect if a groupname alreay is choosen?
I made a command like creategroup:
Код:
dcmd_creategroup(playerid, params[]) { new groupname, g = GetFreeGroupID(); new pName4[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName4,sizeof(pName4)); //if(!IsPlayerAdmin(playerid)) return 0; if(sscanf(params,"u",groupname)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /creategroup [Groupname]"); else { fcreate(GroupFile(g)); format(GroupInfo[g][gName], 35, "%s", groupname); format(GroupInfo[g][gOwner], 25, "%s", pName4); new INI:file = INI_Open(GroupFile(g)); INI_WriteString(file, "GroupName", params); INI_WriteString(file, "GroupOwner", pName4); INI_WriteInt(file, "GroupMoney", 0); INI_WriteInt(file, "GroupScore", 0); INI_WriteInt(file, "GroupKills", 0); INI_WriteInt(file, "GroupDeaths", 0); INI_Close(file); } return 1; }
Admigo