Hello again, today i teach you how make the command for spawn in one location always.. if you "save you position"
|Video|http://www.youtube.com/watch?v=l957Ac0kBP0&feature=youtu.be[pawn]new Float:CoordX[MAX_PLAYERS];
new Float:CoordY[MAX_PLAYERS];
new Float:CoordZ[MAX_PLAYERS];[/pawn]
In the command "REGISTER" COPY THIS DINI_SET [pawn] dini_Set( file, "pX", "-695.528503" );
dini_Set( file, "pY", "706.554931" );
dini_Set( file, "pZ", "12.116538" );[/pawn]
IN ONPLAYERTEXT [pawn] else if ( strcmp( cmd, "!spawn", true ) == 0 )
{
tmp = strtok( cmdtext, idx );
new Dinero = GetPlayerMoney(playerid);
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, 0xF0182DFF, "Login first." );
else
{
if(Dinero >= 1500) {
format(file, sizeof(file), USERS_FILE, gPlayers[playerid]);
GetPlayerPos(playerid, CoordX[playerid], CoordY[playerid], CoordZ[playerid]);
dini_FloatSet(file, "pY", CoordY[playerid]);
dini_FloatSet(file, "pZ", CoordZ[playerid]);
dini_FloatSet(file, "pX", CoordX[playerid]);
SendClientMessage(playerid,0xFFFF00AA,"You are saved you position to spawn");
DecPlayerHandCash(playerid,1500);
}
if(Dinero < 1499) {
SendClientMessage(playerid,0xFFFF00AA,"Need more money to save you position, need $ 1500");
}
}
return 1;
}[/pawn]
in ONPLAYERSPAWN[pawn]SetPlayerPos(playerid, dini_Float(file, "pX"), dini_Float(file, "pY"), dini_Float(file, "pZ"),0,0);
SendClientMessage(playerid,0xFFFF00AA,"You have send to you last position saved");[/pawn]
If you need thank me, send me a pm