SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Tutorials

Reply
 
Thread Tools Display Modes
Old 27/05/2018, 07:13 PM   #1
Salvador75
Little Clucker
 
Salvador75's Avatar
 
Join Date: Aug 2017
Posts: 4
Reputation: 0
Default SAVE TO Y_INI

So anyone help me to how to save to the scripting files this script i mean like this

scriptfiles/postion/username/“name”
playerName = Hujam
posy = 0.0
posz = 0.0
zangle = 0.0

SCRIPT INSIDE #include <a_samp> and float
Quote:
static Floatosx[MAX_PLAYERS] = 0.0;
static Floatosy[MAX_PLAYERS] = 0.0;
static Floatosz[MAX_PLAYERS] = 0.0;
static Float:zangle[MAX_PLAYERS] = 0.0;
SCRIPT
Quote:
if(strcmp(cmdtext, "/saveplace”, true) == 0)
{
SendClientMessage(playerid, COLOR_GREEN, "Your current position was saved! To teleport back here type /l!");
if(IsPlayerInAnyVehicle(playerid))
{
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
GetVehiclePos(VehicleID, posx[playerid], posy[playerid], posz[playerid]);
GetVehicleZAngle(VehicleID, zangle[playerid]);
} else {
GetPlayerPos(playerid, posx[playerid], posy[playerid], posz[playerid]);
GetPlayerFacingAngle(playerid, zangle[playerid]);

}
return 1;
}
if(strcmp(cmdtext, "/loadplace”, true) == 0)
{
SendClientMessage(playerid, COLOR_GREEN, "Your saved position was loaded!");
if(IsPlayerInAnyVehicle(playerid))
{
new VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, posx[playerid], posy[playerid], posz[playerid]);
SetVehicleZAngle(VehicleID, zangle[playerid]);
}
else
{
SetPlayerPos(playerid, posx[playerid], posy[playerid], posz[playerid]);
SetPlayerFacingAngle(playerid, zangle[playerid]);
}
return 1;
}
HOW TO SAVE THE POSITION AND AFTER QUIT WILL SAVE AND AFTER CONNECTED THE POSITION WIL SAVE
AND THEN HE CAN GOTO.
Salvador75 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
y_ini won't save Lukasz56 Scripting Help 10 08/10/2017 03:22 PM
y_ini does not save ahameed4755 Scripting Help 1 05/11/2015 07:12 PM
how to save this with (y_ini) ahameed4755 Scripting Help 4 29/10/2015 11:04 PM
How to save in Y_INI ? kubeba59 Scripting Help 14 31/01/2014 08:37 AM
[Help]Y_ini Don't save on GMX luis_mendoza Scripting Help 3 09/12/2012 06:59 AM


All times are GMT. The time now is 02:22 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.