01.02.2010, 21:57
Hey, I have a script.But I want to save it everytime.
The script just works, but I now want to save it. IT is an script that give permission to use the cop skins.
Now I want that if you relog you still have the permission to spawn with the cop skins.
Can someone give an example or something on how to do this please?
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;
public OnPlayerCommandText(playerid, cmdtext[])
{
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, COLOR_GREEN, "USAGE: /givepermission [playerid]");
giveplayerid = strval(tmp);
if(IsPlayerConnected(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREEN, "Done!");
SkinPermission[giveplayerid] = true;
}
else if (!IsPlayerConnected(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREEN, "ERROR: Player not Conected!");
}
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "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;
}
}
The script just works, but I now want to save it. IT is an script that give permission to use the cop skins.
Now I want that if you relog you still have the permission to spawn with the cop skins.
Can someone give an example or something on how to do this please?
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;
public OnPlayerCommandText(playerid, cmdtext[])
{
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, COLOR_GREEN, "USAGE: /givepermission [playerid]");
giveplayerid = strval(tmp);
if(IsPlayerConnected(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREEN, "Done!");
SkinPermission[giveplayerid] = true;
}
else if (!IsPlayerConnected(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREEN, "ERROR: Player not Conected!");
}
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "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;
}
}