01.08.2013, 11:37
I've got 2 problems one about a textdraw problem and one is about Y_ini saving problem, I just didn't want to put each in a seperate thread so I posted both of them together in one thread.
Problem : Textdraw doesn't show up when I go in-game, I did exactly what samp wiki said https://sampwiki.blast.hk/wiki/Textdraw
+ I get the "loose indentation" warning
This script I made for saving private vehicles for the player, these are important parts of the script :
This at the END of my script :
This is at the beginning :
Problem : There is no problem if I logout and then log out again, problem happens when I restart my server, no variables are saved
I hope you got my problem and can help me, if you can help me even in ONE of them then I would be grateful
Textdraw problem
This is EXACTLY my TEST script :Код:
// This is a comment // uncomment the line below if you want to write a filterscript //#define FILTERSCRIPT #include <a_samp> new Text:welcomeText; #if defined FILTERSCRIPT public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Blank Filterscript by your name here"); print("--------------------------------------\n"); return 1; } public OnFilterScriptExit() { return 1; } #else main() { print("\n----------------------------------"); print(" Blank Gamemode by your name here"); print("----------------------------------\n"); } #endif public OnGameModeInit() { // Don't use these lines if it's a filterscript SetGameModeText("Blank Script"); AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); welcomeText = TextDrawCreate(240.0,580.0,"Welcome to my SA-MP server"); return 1; } public OnGameModeExit() { return 1; } public OnPlayerRequestClass(playerid, classid) { SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746); return 1; } public OnPlayerConnect(playerid) { TextDrawShowForPlayer(playerid,welcomeText); } public OnPlayerDisconnect(playerid, reason) { return 1; } public OnPlayerSpawn(playerid) { return 1; } public OnPlayerDeath(playerid, killerid, reason) { return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/mycommand", cmdtext, true, 10) == 0) { // Do something here return 1; } return 0; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { return 1; } public OnPlayerEnterCheckpoint(playerid) { return 1; } public OnPlayerLeaveCheckpoint(playerid) { return 1; } public OnPlayerEnterRaceCheckpoint(playerid) { return 1; } public OnPlayerLeaveRaceCheckpoint(playerid) { return 1; } public OnRconCommand(cmd[]) { return 1; } public OnPlayerRequestSpawn(playerid) { return 1; } public OnObjectMoved(objectid) { return 1; } public OnPlayerObjectMoved(playerid, objectid) { return 1; } public OnPlayerPickUpPickup(playerid, pickupid) { return 1; } public OnVehicleMod(playerid, vehicleid, componentid) { return 1; } public OnVehiclePaintjob(playerid, vehicleid, paintjobid) { return 1; } public OnVehicleRespray(playerid, vehicleid, color1, color2) { return 1; } public OnPlayerSelectedMenuRow(playerid, row) { return 1; } public OnPlayerExitedMenu(playerid) { return 1; } public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) { return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { return 1; } public OnRconLoginAttempt(ip[], password[], success) { return 1; } public OnPlayerUpdate(playerid) { return 1; } public OnPlayerStreamIn(playerid, forplayerid) { return 1; } public OnPlayerStreamOut(playerid, forplayerid) { return 1; } public OnVehicleStreamIn(vehicleid, forplayerid) { return 1; } public OnVehicleStreamOut(vehicleid, forplayerid) { return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { return 1; } public OnPlayerClickPlayer(playerid, clickedplayerid, source) { return 1; }
+ I get the "loose indentation" warning
Код:
D:\GTA server maker\gamemodes\Textdrawtest.pwn(38) : warning 217: loose indentation D:\GTA server maker\gamemodes\Textdrawtest.pwn(40) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Warnings.
Y_ini saving problem
This script I made for saving private vehicles for the player, these are important parts of the script :
Код:
public OnPlayerConnect(playerid) { INI_ParseFile( user_ini_file( playerid ), "load_user_%s", .bExtra = true, .extra = playerid ); if(pvmodel > 0) { new name[MAX_PLAYER_NAME] , str[2000]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); format(str,sizeof(str),"%s's\nprivate vehicle",name); pv3d = Create3DTextLabel(str, COLOR_WHITE, 0.0, 0.0, -99.0, 20.0, 0, 0); bveh = AddStaticVehicle(pvmodel,0,0,0,0,6,7); pv = 1; Attach3DTextLabelToVehicle(pv3d,bveh,0,0,0); } return 1; }
Код:
stock user_ini_file(playerid) { new string[ 128 ], user_name[ MAX_PLAYER_NAME ] ; GetPlayerName( playerid, user_name, MAX_PLAYER_NAME ); format( string, sizeof ( string ), "%s.ini", user_name ); /* scriptfiles directory */ return string; } forward @load_user_position( playerid, name[], value[] ); @load_user_position( playerid, name[], value[] ) { INI_Int("Bought private vehicle", pv ); INI_Int("Private vehicle model", pvmodel ); return ( 1 ); }
Код:
public OnPlayerDisconnect(playerid, reason) { new INI:File = INI_Open( user_ini_file( playerid ) ); INI_SetTag( File, "Private vehicle" ); INI_WriteInt( File, "Bought private vehicle", pv ); INI_WriteInt( File, "Private vehicle model", pvmodel ); INI_Close( File ); DestroyVehicle(bveh); return 1; }
Код:
new vs; new pvmodel; new Text3D:pv3d; new pv = 0; new bveh;
I hope you got my problem and can help me, if you can help me even in ONE of them then I would be grateful