PHP код:
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#include <foreach>
#include <sscanf2>
#include <dini>
#include <Colours>
#include <streamer>
new vipout,vipin;
new objwindow;
new ttd;
#define MAX_VIP 3
#define PlayerFile "Vip/%s.ini"
#pragma tabsize 0
enum dData
{
Vip
}
new PlayerInfo[MAX_PLAYERS][dData];
public OnFilterScriptInit()
{
CreateDynamicObject(19128, -1217.94666, -387.14209, 518.99902, 0.00000, 0.00000, 0.00000,-1,5);
CreateDynamicObject(19128, -1214.02612, -383.16626, 518.99902, 0.00000, 0.00000, -0.06000,-1,5);
CreateDynamicObject(19128, -1214.01587, -387.13086, 518.99902, 0.00000, 0.00000, 0.00000,-1,5);
CreateDynamicObject(19128, -1217.97839, -383.16403, 518.99902, 0.00000, 0.00000, 0.00000,-1,5);
CreateDynamicObject(19128, -1218.00427, -379.19666, 518.99902, 0.00000, 0.00000, 0.00000,-1,5);
CreateDynamicObject(19128, -1214.05835, -379.21533, 518.99902, 0.00000, 0.00000, 0.00000,-1,5);
CreateDynamicObject(19128, -1214.08606, -375.24207, 518.99902, 0.00000, 0.00000, 0.24000,-1,5);
CreateDynamicObject(19128, -1218.03247, -375.27084, 518.99902, 0.00000, 0.00000, 0.36000,-1,5);
CreateDynamicObject(16151, -1209.59485, -378.44180, 518.96667, 0.00000, 0.00000, 0.00000,-1,5);
CreateDynamicObject(1551, -1210.25610, -375.19528, 519.82001, 0.00000, 0.00000, 0.00000,-1,5);
CreateDynamicObject(1551, -1210.16150, -375.11597, 519.82001, 0.00000, 0.00000, 0.00000,-1,5);
CreateDynamicObject(1667, -1210.24048, -377.13983, 519.69263, 0.00000, 0.00000, 0.00000,-1,5);
CreateDynamicObject(1667, -1210.50806, -378.04355, 519.69263, 0.00000, 0.00000, 0.00000,-1,5);
CreateDynamicObject(2222, -1210.57654, -376.73990, 519.67273, 0.00000, 0.00000, 0.00000,-1,5);
CreateDynamicObject(1726, -1211.54565, -382.83499, 518.95569, 0.00000, 0.00000, 0.00000,-1,5);
CreateDynamicObject(2321, -1211.21484, -385.10190, 518.96478, 0.00000, 0.00000, 0.00000,-1,5);
CreateDynamicObject(1717, -1209.68848, -386.99625, 518.96710, 0.00000, 0.00000, -224.58005,-1,5);
objwindow = CreateDynamicObject(1649, -1210.02478, -372.76074, 520.62000, 0.00000, 0.00000, 180.42030,-1,5);
CreateDynamicObject(14623, -1213.76074, -350.57208, 524.38000, 0.00000, 0.00000, 0.00000,-1,5);
objwindow = CreateDynamicObject(1649, -1218.04407, -373.01587, 520.62000, 0.00000, 0.00000, 180.42030,-1,5);
CreateDynamicObject(14537, -1213.98840, -350.37579, 520.76611, 0.00000, 0.00000, 0.00000,-1,5);
CreateDynamicObject(1978, -1203.67126, -350.19666, 519.88593, 0.00000, 0.00000, 0.00000,-1,5);
CreateDynamicObject(1978, -1224.89404, -350.55569, 519.88593, 0.00000, 0.00000, -180.47987,-1,5);
CreateDynamicObject(2785, -1202.63477, -329.82236, 519.59906, 0.00000, 0.00000, -89.46007,-1,5);
CreateDynamicObject(1902, -1225.21228, -349.32141, 519.71320, 0.00000, 0.00000, 0.00000,-1,5);
CreateDynamicObject(1566, -1217.29309, -312.63956, 524.03137, 0.00000, 0.00000, 0.00000,-1,5);
CreateDynamicObject(1566, -1214.15259, -312.64743, 524.03137, 0.00000, 0.00000, -180.53981,-1,5);
objwindow = CreateDynamicObject(1649, -1218.40845, -389.21640, 520.53223, 0.00000, 0.00000, 180.42030,-1,5);
objwindow = CreateDynamicObject(1649, -1209.79675, -389.19724, 520.50000, 0.00000, 0.00000, 180.42030,-1,5);
objwindow = CreateDynamicObject(1649, -1218.01624, -373.13766, 520.62000, 0.00000, 0.00000, 0.06031,-1,5);
objwindow = CreateDynamicObject(1649, -1210.07336, -372.80917, 520.62000, 0.00000, 0.00000, 0.24034,-1,5);
objwindow = CreateDynamicObject(1649, -1209.78442, -389.20047, 523.76379, 0.00000, 0.00000, 180.42030,-1,5);
objwindow = CreateDynamicObject(1649, -1218.41650, -389.21240, 523.80835, 0.00000, 0.00000, 180.42030,-1,5);
objwindow = CreateDynamicObject(1649, -1214.14050, -389.18695, 520.55334, 0.00000, 0.00000, 180.06032,-1,5);
CreateDynamicObject(4242, -1210.91187, -207.64380, 554.86304, 17.00000, 0.00000, 0.00000,-1,5);
objwindow = CreateDynamicObject(1649, -1214.14050, -389.18695, 523.78577, 0.00000, 0.00000, 180.06032,-1,5);
ttd = CreateDynamicObject(19353, -1221.56519, -368.53357, 520.63837, 0.00000, 0.00000, 62.94001,-1,5);
ttd = CreateDynamicObject(19353, -1205.90637, -368.52194, 520.63843, 0.00000, 0.00000, -62.94000,-1,5);
vipout = CreateDynamicCP(-1881.3136,822.9650,35.1770, 1 , -1 , 0 ,-1,100.0);
vipin = CreateDynamicCP(-1215.7355,-313.0395,523.8566, 1 , -1 , 5 ,-1,100.0);
SetObjectMaterialText(ttd,"{00ff00}Thanks to Dykw", 0, OBJECT_MATERIAL_SIZE_32x32,"Arial", 80, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
new file[256], name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(file,sizeof(file),PlayerFile,name);
if(!dini_Exists(file) )
{
dini_Create(file);
dini_Set(file,"Name",name);
dini_IntSet(file,"Vip",0);
PlayerInfo[playerid][Vip] = 0;
}
else
{
PlayerInfo[playerid][Vip] = dini_Int(file,"Vip");
new string[256];
format(string,sizeof(string),"[VIP]:{ffffff}Your vip level is [$d]",PlayerInfo[playerid][Vip]);
SendClientMessage(playerid,COLOR_GREEN,string);
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new file[256], name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(file,sizeof(file),PlayerFile,name);
if(dini_Exists(file) )
{
dini_IntSet(file,"Vip",PlayerInfo[playerid][Vip]);
}
return 1;
}
public OnPlayerText(playerid, text[])
{
if(text[0] == 'v' )
{
if(PlayerInfo[playerid][Vip] > 0)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
new string[256];
format(string,sizeof(string),"[Vip]%s[rank: %d]:{ffffff}%s",name,PlayerInfo[playerid][Vip],text[0]);
MessageToVips(COLOR_GREEN,string);
return 0;
}
}
return 1;
}
CMD:setvip(playerid,params[])
{
new id, level;
if(sscanf(params,"ud",id,level) ) return SendClientMessage(playerid,COLOR_RED,"[USAGE]:{FFFFFF}/setvip [ID][ level]");
if(!IsPlayerAdmin(playerid) ) return SendClientMessage(playerid,COLOR_RED,"[ERROR]:{FFFFFF}You can't use this command.This is an administrator command.");
if(!IsPlayerConnected(id) ) return SendClientMessage(playerid,COLOR_RED,"Player is not connected");
else
{
new name[MAX_PLAYER_NAME], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
GetPlayerName(id,playername,sizeof(playername));
new fstring[256], zstring[256];
format(fstring,sizeof(fstring),"[ADMIN]:{FFFFFF}%s has set your V.I.P level to %d",name,level);
format(zstring,sizeof(zstring),"[ADMIN]:{FFFFFF}You maked %s level %d",playername,level);
SendClientMessage(playerid,COLOR_GREEN,zstring);
SendClientMessage(id,COLOR_GREEN,fstring);
PlayerInfo[id][Vip] = level;
}
return 1;
}
stock MessageToVips(color, const string[])
{
foreach(Player,i)
{
if(IsPlayerConnected(i) == 1)
if(PlayerInfo[i][Vip] >= 1)
SendClientMessage(i,color,string);
}
}
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == vipout)
{
if(!PlayerInfo[playerid][Vip] >= 1)return SendClientMessage(playerid,COLOR_GREEN,"[VIP]:{FFFFFF}Only vip can go in the vip lounge.");
{
SetTimerEx("togglecp", 2000, false, "i", playerid);
TogglePlayerDynamicCP(playerid, vipin, 0);
PlayAudioStreamForPlayer(playerid,"http://7609.live.streamtheworld.com:80/977_HITS_SC");
if(IsPlayerInAnyVehicle(playerid))return 1;
SetPlayerPos(playerid,-1215.7355,-313.0395,523.8566);
SetPlayerInterior(playerid,5);
SetPlayerFacingAngle( playerid, 180 );
}
}
else if(checkpointid == vipin)
{
SetTimerEx("togglecp", 2000, false, "i", playerid);
TogglePlayerDynamicCP(playerid, vipout, 0);
if(IsPlayerInAnyVehicle(playerid))return 1;
StopAudioStreamForPlayer(playerid);
SetPlayerPos(playerid, -1881.3136,822.9650,35.1770);
SetPlayerInterior(playerid, 0);
SetPlayerFacingAngle( playerid, 45 );
}
return 1;
}
forward togglecp(playerid);
public togglecp(playerid)
{
TogglePlayerDynamicCP(playerid, vipout, 1);
TogglePlayerDynamicCP(playerid, vipin, 1);
return 1;
}