SA-MP Forums Archive
Load playerid to load for all - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Load playerid to load for all (/showthread.php?tid=150570)



Load playerid to load for all - ArTisT - 26.05.2010

Quote:

forward LoadPlayerVehicle(playerid);
public LoadPlayerVehicle(playerid)
{



new openfile[128];
format(openfile, sizeof openfile, VEH_SAVE_FILE, GetName(playerid));
//if (!fexist(openfile)) return 1; // He doesn't own a vehicle
new File:vehs = fopen(openfile,io_read);
new string[256];
new load[40][32];
new newload = 19; // last "strval(load[x])" before the mods loop
if (vehs)
{
print("attempting to read file");
while (fread(vehs, string, 256))
{
split(string, load, '|');

print("spawning vehicles");

I want change this to this: (removed playerid)
Quote:

forward LoadPlayerVehicle();
public LoadPlayerVehicle()
{



new openfile[128];
format(openfile, sizeof openfile, VEH_SAVE_FILE, GetName(playerid));
//if (!fexist(openfile)) return 1; // He doesn't own a vehicle
new File:vehs = fopen(openfile,io_read);
new string[256];
new load[40][32];
new newload = 19; // last "strval(load[x])" before the mods loop
if (vehs)
{
print("attempting to read file");
while (fread(vehs, string, 256))
{
split(string, load, '|');

print("spawning vehicles");

What i need to put here: GetName(playerid)

Info: It's a carownership code (half) wich loads the vehcile only if the player join and i want to change it it should load the car when the server is started