SQL/Script Bugs - Need Help!!!
#1

Hey guys,

I have a South Central RP script I'm using and I'm having issue's trying to sort it out. The main issue's are that house, business, factions, entrances names do not save when you restart the server. Player data such as Origin and DOB don't save either, and if you have set a helper/tester in-game their status resets on relog or restart.

I have spoken to a few people and they said it could be that the SQL is broken, or some sort of issue like that but I'm not a 100% sure. Its just a small community at the moment in the liked to expand.

I would also need some help trying to script paychecks for legal factions, and fix the smuggler job and restrict certain cars for jobs. This may be very easy fixes for some, but for myself I'm still learning and would appreciate any help I could get! I'm doing a game design course in college too so it could help with my project.

Message me via PM or on skype z.shiraz, please if anyone can help!
Reply
#2

Ask the creator of the script, maybe?
Reply
#3

As if he would reply lol?
Reply
#4

If SQL is indeed establishing a connection and other things that rely on accessing the database are working, then it's probably just some things aren't coded to load/save, or there's a problem with the structure of the database. All which are simple to fix.

As for scripting paychecks, very simple, either use a timer for it, or depending on how the servers time is coded to increment, use that so it's a constant time. For example, if your server is based on real time, simply make a backcheck when the hour is incremented.

For vehicles, also extremely simple, example code below:
Код:
	
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(newstate == PLAYER_STATE_DRIVER)
	{
		if(GetPlayerVehicleID(playerid) == x && pInfo[playerid][pGroup] != PLAYER_CLASS) //change to match vehicle ID/group variable
		{
			RemovePlayerFromVehicle(playerid);
			SendClientMessage(playerid, -1, "You must be in x class/group/faction to use this vehicle");
		}
	}
}
Reply
#5

Okay I tried adding those lines and got this:

Quote:

C:\Users\Desktop\PROSPERITY GAMING - 2015\gamemodes\v0.17.pwn(17304) : warning 209: function "AB_OnPlayerStateChange" should return a value
C:\Users\Desktop\PROSPERITY GAMING - 2015\gamemodes\v0.17.pwn(17307) : error 021: symbol already defined: "AB_OnPlayerStateChange"

The lines added:
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(newstate == PLAYER_STATE_DRIVER)
	{
		if(GetPlayerVehicleID(playerid) == 438, 420 && PlayerData[playerid][pJob] != JOB_TAXI) //change to match vehicle ID/group variable
		{
			RemovePlayerFromVehicle(playerid);
			SendErrorMessage(playerid, "You don't have the keys to this vehicle");
		}
	}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)