Need help with saving skin permission
#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.

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

use dini to save someones skin permession
it's like that
1) you juste download dini and include it to your script
2) when player had permession a file with his name will be created and use "permession=1"
3) then when someone connect check on his file if the permession is 1
Reply
#3

Hmm, ive seen this before...

In your other topic, on the same damn page
Reply
#4

Quote:
Originally Posted by m0niSx
use dini to save someones skin permession
it's like that
1) you juste download dini and include it to your script
2) when player had permession a file with his name will be created and use "permession=1"
3) then when someone connect check on his file if the permession is 1
yea. I heard that before. can you maybe explain me more on msn?
Or maybe someone else can help me?

My MSN is:BK_Walker.cwalk@hotmail.com
Reply
#5

someone? Please :P
Reply
#6

Guys, this is so important for me. Aren't you guys helping me because you don't know it?
or because you dont want it? :P

THis is so imprtant
Reply
#7

Can someone please please please help me.
I post this so you can see the thread again. Sorry if this is against the rules
Reply
#8

Hey i dont know why they dint help you that mess up but i dont know if this will work but try putting this all the way on the top
PHP код:
#include <dini> 
Reply
#9

When you save the player, add this (dini)
pawn Код:
dini_IntSet(file, "SkinPerm", SkinPermission[playerid]);
That sets their skin permission. Now, when you load it, do this.

pawn Код:
SkinPermission[playerid] = dini_Int(file, "SkinPerm");
Since you may not have file defined, do this each time you use it, before the code:

pawn Код:
new file[80], name[MAX_PLAYER_NAME];
format(file,sizeof(file),"Users/%s.ini", GetPlayerName(playerid, name, sizeof(name)); //Example
Change "Users/%s.ini" to the file location. So if you were just putting it in the scriptfiles folder, remove "Users/"

Hope I helped.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)