SA-MP Forums Archive
I really need your help. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I really need your help. (/showthread.php?tid=125292)



I really need your help. - bartje01 - 03.02.2010

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)


Re: I really need your help. - bartje01 - 03.02.2010

No one knows how to fix this??


Re: I really need your help. - Salt - 03.02.2010

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


Re: I really need your help. - Nakash - 03.02.2010

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.