I really need your help.
#1

Hello everyone. I am already trying to save someone his permission for a skin for a phew days.
I really can't come out. Someone helped me but we didn't succeed.The skin permission works, but only for 1 time.
I want that when I /permission someone he has it for ever.
I hope someone can help me. This is really important for my gamemode.
If someone doesn't understand it. Just say it. I really need this.

This my gamemode:
http://pastebin.com/m3f852591
You can find everyting of the skin permission here:

Top of script:
new bool:SkinPermission[MAX_PLAYERS];


public OnPlayerConnect(playerid)
{
SkinPermission[playerid] = false;

return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
SkinPermission[playerid] = false;
return 1;
}

public OnPlayerSpawn(playerid)
{
SkinPermission[playerid] = false;


}
new cmd[256],
idx;

cmd = strtok(cmdtext, idx);
if(strcmp(cmd,"/givepermission", true) == 0)
{
if(IsPlayerAdmin(playerid))
{
new tmp[128];
new giveplayerid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
return SendClientMessage(playerid, 0xE3E3E3FF, "USAGE: /givepermission [playerid]");

giveplayerid = strval(tmp);
if(IsPlayerConnected(giveplayerid))
{
SendClientMessage(playerid, 0xE3E3E3FF, "Done!");
SkinPermission[giveplayerid] = true;
}
else if (!IsPlayerConnected(giveplayerid))
{
SendClientMessage(playerid, 0xE3E3E3FF, "ERROR: Player not Conected!");
}
}
else
{
SendClientMessage(playerid, 0xE3E3E3FF, "ERROR: You are not an Administrator!");
}
return 1;


public OnPlayerRequestSpawn(playerid)
{
{
new Skin;
Skin = GetPlayerSkin(playerid);
if(Skin == 280)
{
if(SkinPermission[playerid] == false)
{
GameTextForPlayer(playerid,"~w~You don't have permission for this skin",3000,5);
return 0;
}
}

}

{
new Skin;
Skin = GetPlayerSkin(playerid);
if(Skin == 281)
{
if(SkinPermission[playerid] == false)
{
GameTextForPlayer(playerid,"~w~You don't have permission for this skin",3000,5);
return 0;
}
}

}

{
new Skin;
Skin = GetPlayerSkin(playerid);
if(Skin == 282)
{
if(SkinPermission[playerid] == false)
{
GameTextForPlayer(playerid,"~w~You don't have permission for this skin",3000,5);
return 0;
}
}
return 1;
}

}



Regards, Bart (A)
Reply
#2

No one knows how to fix this??
Reply
#3

If you want it to save when you quit/log back in, you need to create files for each user otherwise the permission wont save.

Search for "dini tutorial" if you need help with those things
Reply
#4

You need to create files then when the client logs in you give him back his permission using the file.
For example the server creates a file when a client enters and when you do /givepermission ID
it changes something in the file,then when the client connects again you give him back his access.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)