SA-MP Forums Archive
Creating saved 3DTextLabel OnGameModeInit - 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: Creating saved 3DTextLabel OnGameModeInit (/showthread.php?tid=187980)



Creating saved 3DTextLabel OnGameModeInit - AirGuy92 - 05.11.2010

I have this /parkhere command:

Код:
if(!strcmp(cmdtext, "/parkhere", true))
    {
        if(gPlayerLogged[playerid] == 1)
	    {
	        if(IsPlayerInAnyVehicle(playerid))
			{
       			new name[MAX_PLAYER_NAME], file[256];
			    GetPlayerName(playerid, name, sizeof(name));
			    format(file, sizeof(file), SERVER_USER_FILE, name);

			    GetVehiclePos(GetPlayerVehicleID(playerid), P1, P2, P3);
			    GetVehicleZAngle(GetPlayerVehicleID(playerid), P4);
			
		        dini_FloatSet(file, "ParkingPosX", P1);
		        dini_FloatSet(file, "ParkingPosY", P2);
		        dini_FloatSet(file, "ParkingPosZ", P3);
		        dini_FloatSet(file, "ParkingAng", P4);
		        SendClientMessage(playerid, GREEN, "You've successfully created your parking space!");
		        
		        Create3DTextLabel("This parking space is reserved", YELLOW, P1, P2, P3+1, 20, 0, 0);
	        }
	        else
	        {
	            SendClientMessage(playerid, RED, "You're not in a vehicle!");
	        }
	    }
	    gPlayerLogged[playerid] = 0;
        return 1;
    }
And I get all things in there to work. Now what I want to do is to save the 3DTextLabel somehow, and then always recreate it on GameModeInit.

How should I do this?


Re: Creating saved 3DTextLabel OnGameModeInit - MadeMan - 05.11.2010

Save the coordinates to a file (with dini for example) and then load them OnGameModeInit.