View Single Post
Old 26/05/2010, 08:45 PM   #1
ArTisT
Big Clucker
 
Join Date: Mar 2009
Posts: 99
Reputation: 0
Default Load playerid to load for all

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
ArTisT is offline