Give me your OnGameModeInIt and portion which has AddPlayerClass native's !
|
public OnGameModeInit()
{
Streamer_TickRate(150);
Streamer_CellDistance(300);
//Audio_CreateTCPServer(7777);
//Audio_SetPack("default_pack", true);
new ip[ 32 ];
GetServerVarAsString( "bind", ip, sizeof( ip ) );
mysql_connect( DB_USERNAME, DB_HOSTNAME, DB_PASSWORD, DB_DATABASE );
if(fexist("CRP/Other/JoinCounter.cfg"))
{
JoinCounter = dini_Int("CRP/Other/JoinCounter.cfg", "Connections");
} else {
dini_Create("CRP/Other/JoinCounter.cfg");
dini_IntSet("CRP/Other/JoinCounter.cfg", "Connections", 0);
}
//==========================================================================
for(new c=0;c<MAX_VEHICLES;c++)
{
Fuel[c] = 100;
VehicleLightsOn[c] = false;
}
//==========================================================================
for(new i = 0; i < MAX_PLAYERS; i++) { ShowHud[i] = 1; }
new query[1328];
format(query, sizeof(query), "UPDATE Accounts SET CarKey = '0'");
mysql_query(query);
format(query, sizeof(query), "UPDATE Accounts SET WeedTimer = '0'");
mysql_query(query);
format(query, sizeof(query), "UPDATE Accounts SET Online = '0'");
mysql_query(query);
//==========================================================================
ConnectNPC("Pizzbot1","PizzaNPC");
ShowPlayerMarkers(0);
ShowNameTags(1);
ManualVehicleEngineAndLights();
SetNameTagDrawDistance(30.0);
EnableStuntBonusForAll(0);
DisableInteriorEnterExits();
AllowInteriorWeapons(1);
//AllowAdminTeleport(1);
AntiDeAMX();
// Load Stuff here
LoadLocations();
LoadHouses();
LoadGarages();
LoadBuilding();
LoadBusiness();
LoadCityCars();
LoadFactions();
//CreateCityObjects();
// Stuff have now been loaded.
print("-----------------------------------------------");
print("P:RP Make by N0FeaR");
print("! SCRIPT LOADED SCRIPT LOADED SCRIPT LOADED SCRIPT LOADED !");
print("-----------------------------------------------");
// Welcome message done
//==========================================================================
//========================================================================== Pickups
CreateStreamPickup(1239,1,1737.2125,-1862.9502,13.5757,10); // Noobspawn Guide
CreateStreamPickup(1239,1,-1425.6927,-1528.2820,101.9709,10);
//========================================================================== Textdraw
new string[MAX_PLAYER_NAME];
new string1[MAX_PLAYER_NAME];
News[hTaken1] = 0; News[hTaken2] = 0; News[hTaken3] = 0; News[hTaken4] = 0; News[hTaken5] = 0;
//==========================================================================
format(string, sizeof(string), "Nothing");
strmid(News[hAdd1], string, 0, strlen(string), 255);
strmid(News[hAdd2], string, 0, strlen(string), 255);
strmid(News[hAdd3], string, 0, strlen(string), 255);
strmid(News[hAdd4], string, 0, strlen(string), 255);
strmid(News[hAdd5], string, 0, strlen(string), 255);
strmid(News[hAdd6], string, 0, strlen(string), 255);
strmid(News[hAdd7], string, 0, strlen(string), 255);
strmid(News[hAdd8], string, 0, strlen(string), 255);
strmid(News[hAdd9], string, 0, strlen(string), 255);
strmid(News[hAdd10], string, 0, strlen(string), 255);
strmid(News[hAdd11], string, 0, strlen(string), 255);
strmid(News[hAdd12], string, 0, strlen(string), 255);
strmid(News[hAdd13], string, 0, strlen(string), 255);
strmid(News[hAdd14], string, 0, strlen(string), 255);
strmid(News[hAdd15], string, 0, strlen(string), 255);
strmid(News[hAdd16], string, 0, strlen(string), 255);
strmid(News[hAdd17], string, 0, strlen(string), 255);
strmid(News[hAdd18], string, 0, strlen(string), 255);
strmid(News[hAdd19], string, 0, strlen(string), 255);
strmid(News[hAdd20], string, 0, strlen(string), 255);
strmid(News[hAdd21], string, 0, strlen(string), 255);
format(string1, sizeof(string1), "No-one");
strmid(News[hContact1], string1, 0, strlen(string1), 255);
strmid(News[hContact2], string1, 0, strlen(string1), 255);
strmid(News[hContact3], string1, 0, strlen(string1), 255);
strmid(News[hContact4], string1, 0, strlen(string1), 255);
strmid(News[hContact5], string1, 0, strlen(string1), 255);
strmid(News[hContact6], string1, 0, strlen(string1), 255);
strmid(News[hContact7], string1, 0, strlen(string1), 255);
strmid(News[hContact8], string1, 0, strlen(string1), 255);
strmid(News[hContact9], string1, 0, strlen(string1), 255);
strmid(News[hContact10], string1, 0, strlen(string1), 255);
strmid(News[hContact11], string1, 0, strlen(string1), 255);
strmid(News[hContact12], string1, 0, strlen(string1), 255);
strmid(News[hContact13], string1, 0, strlen(string1), 255);
strmid(News[hContact14], string1, 0, strlen(string1), 255);
strmid(News[hContact15], string1, 0, strlen(string1), 255);
strmid(News[hContact16], string1, 0, strlen(string1), 255);
strmid(News[hContact17], string1, 0, strlen(string1), 255);
strmid(News[hContact18], string1, 0, strlen(string1), 255);
strmid(News[hContact19], string1, 0, strlen(string1), 255);
strmid(News[hContact20], string1, 0, strlen(string1), 255);
strmid(News[hContact21], string1, 0, strlen(string1), 255);
format(crimestore, sizeof(crimestore), "[HQ] There is nothing in your vicinity, over");
//==========================================================================
AddCCTV("Airport", 1775, -2440, 34, 180.0, 1775, -2440, 34);
AddCCTV("Pershing Square", 1429, -1581, 63, 220.0, 1429, -1581, 63);
AddCCTV("License Centre", 1311, -1421, 27, 0.0, 1311, -1421, 27);
AddCCTV("Downtown Los Santos", 1590, -1332, 24, 0.0, 1590, -1332, 24);
AddCCTV("News Building", 1018, -930, 56, 95.0, 1018, -930, 56);
AddCCTV("Transport Building", 361, -1494, 46, 115.0, 361, -1494, 46);
AddCCTV("Grove Street", 2317, -1665, 28, 0.0, 2320, -1678, 15);
AddCCTV("Glen Park", 1858, -1160, 37, 270.0, 1858, -1160, 37);
AddCCTV("Mulholland Intersection", 1653, -1076, 28, 180.0, 1653, -1076, 28);
AddCCTV("Los Santos Beach", 325, -1811, 12, 0.0, 325, -1811, 12);
AddCCTV("El Corona", 1914, -1980, 38, 144.0, 1914, -1980, 38);
AddCCTV("Seville", 2762, -2004, 19, 18.0, 2762, -2004, 19);
AddCCTV("Crenshaw", 2088, -1416, 46, 295.0, 2088, -1416, 46);
AddCCTV("Mall Road", 945, -1418, 30, 337.0, 945, -1418, 30);
//==========================================================================
TD = TextDrawCreate(160, 400, "~y~Keys:~n~Arrow-Keys: ~w~Move The Camera~n~~y~Sprint-Key: ~w~Speed Up~n~~y~Crouch-Key: ~w~Exit Camera");
TextDrawLetterSize(TD, 0.4, 0.9);
TextDrawSetShadow(TD, 0);
TextDrawUseBox(TD,1);
TextDrawBoxColor(TD,0x00000055);
TextDrawTextSize(TD, 380, 400);
new Count, Left = TotalCCTVS;
for(new menu; menu<MAX_CCTVMENUS; menu++)
{
if(Left > 12)
{
CCTVMenu[menu] = CreateMenu("Choose Camera:", 1, 200, 100, 220);
TotalMenus++;
MenuType[menu] = 1;
for(new i; i<11; i++)
{
AddMenuItem(CCTVMenu[menu], 0, CameraName[Count]);
Count++;
Left--;
}
AddMenuItem(CCTVMenu[menu], 0, "Next");
}
else if(Left<13 && Left > 0)
{
CCTVMenu[menu] = CreateMenu("Choose Camera:", 1, 200, 100, 220);
TotalMenus++;
MenuType[menu] = 2;
new tmp = Left;
for(new i; i<tmp; i++)
{
AddMenuItem(CCTVMenu[menu], 0, CameraName[Count]);
Count++;
Left--;
}
}
}
for(new h = 0; h < sizeof(Houses); h++)
{
if(Houses[h][Owned] == 0)
{
Create3DTextLabel("[Property]",0x00AE00FF,Houses[h][EnterX], Houses[h][EnterY], Houses[h][EnterZ]+0.75, 25.0, 0);
Houses[h][hPickupID]=CreateDynamicPickup(1273, 1, Houses[h][EnterX], Houses[h][EnterY], Houses[h][EnterZ]);
//pickups++;
}
if(Houses[h][Owned] == 1)
{
Create3DTextLabel("[Property]",0x00AE00FF,Houses[h][EnterX], Houses[h][EnterY], Houses[h][EnterZ]+0.75, 25.0, 0);
Houses[h][hPickupID]=CreateDynamicPickup(1239, 1, Houses[h][EnterX], Houses[h][EnterY], Houses[h][EnterZ]);
//pickups++;
}
}
SetTimer("OneSecTimers", 1000, 1); //1sec
SetTimer("LiftDown", 13000, 0); //13sec
SetTimer("OneMinuteTimer", 60000, 1);
SetTimer("CheckStatus", 1300, 1); // 500 mili sekunder
//SetTimer("AntiHackWeapon", 3000, 1); // TO CHECK FOR WEAPONS, DONE EACH 3 SECOND
if (realtime)
{
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
FixHour(tmphour);
tmphour = shifthour;
SetWorldTime(tmphour);
}
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SpawnPlayer(playerid);
return 1;
}
lazy but might work if you don't use the class selector..
pawn Код:
|
public OnPlayerRequestClass(playerid, classid)
{
if(IsPlayerNPC(playerid)) return 1;
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
if(RegistrationStep[playerid] == 0 && gPlayerLogged[playerid] != 1)
{
InitPlayerConnection( playerid );
} else {
SpawnPlayer(playerid);
}
return 0;
}