Creating saved 3DTextLabel OnGameModeInit
#1

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?
Reply
#2

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


Forum Jump:


Users browsing this thread: 1 Guest(s)