10.09.2011, 15:30
Need help how to make gate with password and /changegatepass
CMD:opengate(playerid, params[])
{
new password1[35];
if(sscanf(params, "s", password1)) return SendClientMessage(playerid, 0x00FF0000, "/opengate Password");
else
{
if(!dini_Exists("password.txt"))
{
dini_Create("password.txt");
dini_Set("password.txt", "password", password);
}
if(dini_Exists("password.txt"))
{
dini_Get("password.txt", password);
if(!strcmp(password, password1) == 0)
{
// Move object function
}
else
{
SendClientMessage(playerid, 0x00FF0000, "Wrong password!");
}
}
}
}
CMD:setpassword(playerid, params[])
{
new password1[35];
if(sscanf(params, "s", password1)) return SendClientMessage(playerid, 0x00FF0000, "Enter a password!");
else
{
if(dini_Exists("password.txt");
{
dini_Set("password.txt", "password", password1);
SendClientMessage(playerid, 0x00FF0000, "Done!");
}
}
}
if(PlayerInfo[playerid][pMember] == 1) // or, if you're working with SetPlayerTeam, simply add: if(GetPlayerTeam(playerid == TEAM_ID)) //or
if(gTeam[playerid] == YOUR_TEAM)