Please Help with new AddPlayerClass sytem
#1

I'm trying to make an RP class system but I cant seem to get it to run.

Код:
for(i = 0; i < GroveStreetFemales; i++) { if(IsValidSkin(GroveStreetFemaleSkins[i])) { AddPlayerClass(GroveStreetFemaleSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
GroveStreetFemales would be defined as:
define GroveStreetFemales 3

GroveStreetFemaleSkins would be defined as:
new GroveStreetFemaleSkins[] = { 269, 270, 271 };

Код:
main() { print("\n-----------------------------------"); print("  .:Egdod Real Life MySQL:."); print("-----------------------------------\n"); }

public OnGameModeInit()
{
	SetGameModeText("Egdod Real Life");
	pSavePlayersTimer = SetTimer("pSQLSavePlayers", pSavePlayersTime, 1);
	printf("Player Auto Save Timer Set.");
	LoadTutorial();
	printf("Tutorials Loaded.");
	TutorialTimer = SetTimer("OnTutorialTimer", 10000, 1);
	printf("Tutorial Timer Set.");
	/*for(new i = 0; i < 299; i++)
  {
    if(IsValidSkin(i))
    {
      AddPlayerClass(i,0.0,0.0,0.0,0.0,-1,-1,-1,-1,-1,-1);
    }
  }*/
  pAddClasses();
	printf("Player Classes Added.");
	vLoadSQLVehicles();
	printf("Vehicles Loaded.");
	vVehicleRespawnTimer = SetTimer("vLoadSQLVehicles", vVehicleRespawnTime, 1);
	printf("Vehicle Respawn Timer Set.");
	return 1;
}
Code for pAddClasses():
Код:
pAddClasses() {
	new i = 0;
	for(i = 0; i < GroveStreetFemales; i++) { if(IsValidSkin(GroveStreetFemaleSkins[i])) { AddPlayerClass(GroveStreetFemaleSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < GroveStreetMales; i++) { if(IsValidSkin(GroveStreetMaleSkins[i])) { AddPlayerClass(GroveStreetMaleSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < Ballas; i++) { if(IsValidSkin(BallaSkins[i])) { AddPlayerClass(BallaSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < CripMales; i++) { if(IsValidSkin(CripMaleSkins[i])) { AddPlayerClass(CripMaleSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < VariosLosAztecas; i++) { if(IsValidSkin(VariosLosAztecaSkins[i])) { AddPlayerClass(VariosLosAztecaSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < LosSantosVagos; i++) { if(IsValidSkin(LosSantosVagoSkins[i])) { AddPlayerClass(LosSantosVagoSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < DaNangBoys; i++) { if(IsValidSkin(DaNangBoySkins[i])) { AddPlayerClass(DaNangBoySkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < SanFierroRifas; i++) { if(IsValidSkin(SanFierroRifaSkins[i])) { AddPlayerClass(SanFierroRifaSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < Triads; i++) { if(IsValidSkin(TriadSkins[i])) { AddPlayerClass(TriadSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < Bikers; i++) { if(IsValidSkin(BikerSkins[i])) { AddPlayerClass(BikerSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i > MifiaFemales; i++) { if(IsValidSkin(MifiaFemaleSkins[i])) { AddPlayerClass(MifiaFemaleSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i > MifiaMales; i++) { if(IsValidSkin(MifiaMaleSkins[i])) { AddPlayerClass(MifiaMaleSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < FederalAgents; i++) { if(IsValidSkin(FederalAgentSkins[i])) { AddPlayerClass(FederalAgentSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < Paramedics; i++) { if(IsValidSkin(ParamedicSkins[i])) { AddPlayerClass(ParamedicSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < FireFighters; i++) { if(IsValidSkin(FireFighterSkins[i])) { AddPlayerClass(FireFighterSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < PoliceLeaders; i++) { if(IsValidSkin(PoliceLeaderSkins[i])) { AddPlayerClass(PoliceLeaderSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < Police; i++) { if(IsValidSkin(PoliceSkins[i])) { AddPlayerClass(PoliceSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < BeachFemales; i++) { if(IsValidSkin(BeachFemaleSkins[i])) { AddPlayerClass(BeachFemaleSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < BeachMales; i++) { if(IsValidSkin(BeachMaleSkins[i])) { AddPlayerClass(BeachMaleSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < FarmerFemales; i++) { if(IsValidSkin(FarmerFemaleSkins[i])) { AddPlayerClass(FarmerFemaleSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < FarmerMales; i++) { if(IsValidSkin(FarmerMaleSkins[i])) { AddPlayerClass(FarmerMaleSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < Whores; i++) { if(IsValidSkin(WhoreSkins[i])) { AddPlayerClass(WhoreSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < Golfers; i++) { if(IsValidSkin(GolferSkins[i])) { AddPlayerClass(GolferSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < MountainBikers; i++) { if(IsValidSkin(MountainBikerSkins[i])) { AddPlayerClass(MountainBikerSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < BoxerMales; i++) { if(IsValidSkin(BoxerMaleSkins[i])) { AddPlayerClass(BoxerMaleSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < DetectiveFemales; i++) { if(IsValidSkin(DetectiveFemaleSkins[i])) { AddPlayerClass(DetectiveFemaleSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < DetectiveMales; i++) { if(IsValidSkin(DetectiveMaleSkins[i])) { AddPlayerClass(DetectiveMaleSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < NinjaTrainers; i++) { if(IsValidSkin(NinjaTrainerSkins[i])) { AddPlayerClass(NinjaTrainerSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < BodyguardMales; i++) { if(IsValidSkin(BodyguardMaleSkins[i])) { AddPlayerClass(BodyguardMaleSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < BodyguardFemales; i++) { if(IsValidSkin(BodyguardFemaleSkins[i])) { AddPlayerClass(BodyguardFemaleSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < Cunstructors; i++) { if(IsValidSkin(CunstructorSkins[i])) { AddPlayerClass(CunstructorSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < Homeless; i++) { if(IsValidSkin(HomelessSkins[i])) { AddPlayerClass(HomelessSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < ArmsDealers; i++) { if(IsValidSkin(ArmsDealerSkins[i])) { AddPlayerClass(ArmsDealerSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i < DrugDealers; i++) { if(IsValidSkin(DrugDealerSkins[i])) { AddPlayerClass(DrugDealerSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i <= Males; i++) { if(IsValidSkin(MaleSkins[i])) { AddPlayerClass(MaleSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
	for(i = 0; i <= Females; i++) { if(IsValidSkin(FemaleSkins[i])) { AddPlayerClass(FemaleSkins[i], 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0); } }
  AddPlayerClass(CripFemaleSkin, 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0);
	AddPlayerClass(PilotSkin, 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0);
	AddPlayerClass(TaxiDriverMaleSkin, 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0);
 	AddPlayerClass(TaxiDriverFemaleSkin, 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0);
	AddPlayerClass(ClownSkin, 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0);
	AddPlayerClass(DoctorSkin, 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0);
	AddPlayerClass(BoxerFemaleSkin, 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0);
	AddPlayerClass(SkaterSkin, 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0);
	AddPlayerClass(JoggerSkin, 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0);
	AddPlayerClass(RollerBladerSkin, 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0);
	AddPlayerClass(MountainClimberSkin, 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0);
	AddPlayerClass(SwatSkin, 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0);
	AddPlayerClass(ArmySkin, 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0);
	AddPlayerClass(MechanicSkin, 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0);
	AddPlayerClass(FederalAgentMaleLeaderSkin, 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0);
	AddPlayerClass(FederalAgentFemaleLeaderSkin, 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0);
	AddPlayerClass(MafiaMaleLeaderSkin, 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0);
	AddPlayerClass(MafiaFemaleLeaderSkin, 1436.6884, -1204.0343, 195.0468, 121.5246, 0, 0, 0, 0, 0, 0);
}
It starts but doesn't finish. Here take a look:
Код:
----------
Loaded log file: "server_log.txt".
----------

SA:MP Dedicated Server
----------------------
v0.2X, ©2005-2008 SA:MP Team

[02:03:13] 
[02:03:13] Server Plugins
[02:03:13] --------------
[02:03:13] Loading plugin: sampmysql
[02:03:13] 
/************************************************/
/* SAMP-MySQL v0.1 Plugin loaded successfully ! */
/************************************************/

[02:03:13]  Loaded.
[02:03:13] Loaded 1 plugins.

[02:03:13] 
[02:03:13] Filter Scripts
[02:03:13] ---------------
[02:03:13]  Loading filter script 'adminspec.amx'...
[02:03:13]  Loading filter script 'vactions.amx'...
[02:03:13]  Loaded 2 filter scripts.

[02:03:13] Player Auto Save Timer Set.
[02:03:13] Tutorials Loaded.
[02:03:13] Tutorial Timer Set.
[02:03:13] 
----------------------------------
[02:03:13]  .:Egdod Real Life MySQL:.
[02:03:13] ----------------------------------
It doesn't get passed pAddClasses(). How do I fix this?
Reply
#2

Which line is exactly 46?
Reply
#3

I edited it a lot, take a look.
Reply
#4

Does anyone know?
Reply
#5

Is there anyway to execute this properly?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)