03.02.2010, 09:31
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)
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)