License System Bug... -
juuleman - 09.03.2010
Hey Guys,
Can someone please help me with this?:
I made a license system for my server and if i try it when only i am on server (selfhost) it works.
But if i load it to my host so all players have it, it isnt working or only a few players need it...
Does anybody know whats wrong with this:
pawn Код:
#include <a_samp>
#include <a_objects>
#include <a_players>
#include <a_vehicles>
#include <datagram>
#include <float>
#include <file>
#include <string>
#include <time>
#include <dudb>
#include <Dini>
#include <dutils>
#define COLOR_RED 0xFF0000FF
#define COLOR_LIME 0x00FF00FF
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_GREEN 0x33AA33AA
forward Timer(playerid, timerid);
new License[MAX_PLAYERS];
new playername[MAX_PLAYER_NAME];
stock PlayerName(playerid) {
new name[255];
GetPlayerName(playerid, name, 255);
return name;
}
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
new formatZ[256];
new pName[MAX_PLAYER_NAME];
new string[48];
format(formatZ,sizeof(formatZ),"/licenses/%s.txt",PlayerName(playerid));
if(!udb_Exists(formatZ))
{
udb_Create(formatZ,"209010");
}
License[playerid] = dUserINT(formatZ).("License");
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new formatZ2[256];
new pName[MAX_PLAYER_NAME];
new string[56];
format(formatZ2,sizeof(formatZ2),"/licenses/%s.txt",PlayerName(playerid));
dUserSetINT(formatZ2).("License",License[playerid]);
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/buylicense", cmdtext, true, 10) == 0)
{
if IsPlayerInRangeOfPoint(playerid,20,-2029.6173,-111.4781,1035.1719)
*then {
SendClientMessage(playerid, COLOR_GREEN, "You have bought your driving license");
License[playerid] = 1;
GivePlayerMoney(playerid, - 500);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not in the SF DMV!");
}
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(License[playerid] == 0)
{
SetTimer("Timer",4500,false);
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
public Timer(playerid, timerid)
{
SendClientMessage(playerid, COLOR_RED, "You dont have a driving license, you are not able to drive a vehicle");
SendClientMessage(playerid, COLOR_WHITE, "HINT: Buy a driving license in the San Fierro DMV.");
SendClientMessage(playerid, COLOR_WHITE, "TIP: Dont know where the SF DMV is? Ask a player!");
RemovePlayerFromVehicle(playerid);
return 1;
}
Please someone help me...
Greetings,
[ECR]SancheZ
Re: License System Bug... -
Torran - 09.03.2010
What host do you have?
Re: License System Bug... -
juuleman - 09.03.2010
ServerFFS
Re: License System Bug... -
Torran - 09.03.2010
Hmm,
I have seen alot of people have issues with this,
And alot of people say its because ServerFFS is linux,
Re: License System Bug... -
juuleman - 09.03.2010
Realy? Is that the problem?
You've seen the script?
Re: License System Bug... -
Torran - 09.03.2010
Well i have seen loads and loads and loads of topics about people saying that a certain bit of thre script or all of it works on there self host,
But when they put it on there host, It dosent work, And when people have asked for there host it has always been ServerFFS
Re: License System Bug... -
juuleman - 09.03.2010
Hmmm so you dont know it for shure...
I hope someone does know it for shure cause if that is the problem i change host.