littlewhitey's Servers Forum (SA-MP/VC-MP/MTA/Zomboid)

Other => Off-Topic => Programming => Topic started by: Faraday on November 07, 2010, 09:48:02 AM

Title: Need Help? Ask it here!
Post by: Faraday on November 07, 2010, 09:48:02 AM
If you have a problem with something you are working on and can't get it fixed?

Ask here for help and we'll help you fix it!
Title: Re: Need Help? Ask it here!
Post by: Fuse on November 09, 2010, 05:50:18 PM
I forgot what functions i should use to limit areas (with X and Y coords.)
Title: Re: Need Help? Ask it here!
Post by: Sjitty on November 09, 2010, 06:18:40 PM
http://wiki.sa-mp.com/wiki/SetPlayerWorldBounds (http://wiki.sa-mp.com/wiki/SetPlayerWorldBounds)
Title: Re: Need Help? Ask it here!
Post by: Fuse on November 09, 2010, 07:44:17 PM
thanks :)
Title: Re: Need Help? Ask it here!
Post by: Fuse on November 12, 2010, 08:00:59 PM
Some of my scripts doesnt load on the linux server, but they run on my windows server.
Why?
Title: Re: Need Help? Ask it here!
Post by: Sjitty on November 12, 2010, 08:14:39 PM
u using plugins? if so make sure u have the .so for linux instead of the .dll files for windows in the plugin folder.
else i dont have an idea
Title: Re: Need Help? Ask it here!
Post by: Fuse on November 12, 2010, 08:21:51 PM
Well, there are no plugins. :-\
Title: Re: Need Help? Ask it here!
Post by: Faraday on November 12, 2010, 08:45:23 PM
Is it a hosted linux server? Or do you have your own system?
If it's your own system, redownload the server package and try again. Otherwise, what errors are you getting in rcon console?

If it's a hosted server, go to the control panel and try to reinstall the server package (if it's an option), again: what errors appear in server log/console? Does the server crash? You can try and contact your host..
Title: Re: Need Help? Ask it here!
Post by: Fuse on November 12, 2010, 09:02:08 PM
Okay, It's hosted by someone else, i use FTP to reach it.
And also, I get no errors, the log just says "ladmin loaded, etc etc"
It's all as it should be in the logs but the server won't start.
When i add the script to the FS line, in the server.cfg and reboot the server,
it doesnt start, just restarts over and over again.

And when i then remove it from the cfg file, the server starts up.
Title: Re: Need Help? Ask it here!
Post by: Faraday on November 12, 2010, 10:53:15 PM
If the server has an auto-restart script running (which your host should know), it means that the filterscript you're trying to load crashes the server, which makes it auto-restart again.
A thing which comes to my mind is, have you correctly filled in the filterscripts line in your server.cfg file? No extensions added etc?
Does the Filterscript compile right? I suggest you ask your host whats wrong if the problem isn't located in the server.cfg..
Title: Re: Need Help? Ask it here!
Post by: Fuse on November 12, 2010, 11:37:42 PM
I fixed it, apperently i had to go to the CP and restart the server, /Rcon exit was the problem
Title: Re: Need Help? Ask it here!
Post by: Faraday on November 12, 2010, 11:46:39 PM
Ah, nice to see you were able to fix it!
Title: Re: Need Help? Ask it here!
Post by: Fuse on November 12, 2010, 11:50:17 PM
Thx for the help though

Oh by the way, i heard LW's previous "oldschool" Duelscript was able to borrow, is that true?
Title: Re: Need Help? Ask it here!
Post by: Faraday on November 13, 2010, 08:23:32 AM
Sneaky made that script, I think, so I guess it's up to him.
Title: Re: Need Help? Ask it here!
Post by: Ez on November 13, 2010, 08:55:11 AM
The previous version of the duel script is embedded in the gamemode and isn't a stand alone filterscript. I'm sure there are plenty of basic duel scripts on the SA-MP forum script showroom and it isn't very diffucult to make one anyway  :)
Title: Re: Need Help? Ask it here!
Post by: Faraday on November 13, 2010, 09:28:36 AM
I remember KmanN sending me a duel-filterscript once, was the same as Nx server a while back.
Title: Re: Need Help? Ask it here!
Post by: Fuse on November 13, 2010, 11:41:05 AM
Okay, nvm.
I made a duelscript.
Title: Re: Need Help? Ask it here!
Post by: Faraday on November 13, 2010, 12:00:19 PM
Show us! (http://forum.littlewhiteys.co.uk/index.php/topic,14309.0.html)
Title: Re: Need Help? Ask it here!
Post by: Fuse on November 13, 2010, 12:09:54 PM
Nah. :)
Title: Re: Need Help? Ask it here!
Post by: Slice on November 14, 2010, 05:47:47 PM
I remember KmanN sending me a duel-filterscript once, was the same as Nx server a while back.
I made that..! Btw if anyone still has the Nx server source, pls give! I wanna see how much i failed at scripting back then.


@Simon.: Your script is probably so great, you have to keep it for yourself. I'm guessing nobody ever made anything like it!
Title: Re: Need Help? Ask it here!
Post by: Fuse on November 15, 2010, 07:45:03 AM
not really, good enough tho :)
Title: Re: Need Help? Ask it here!
Post by: tony_ab on November 15, 2010, 12:37:35 PM
I remember KmanN sending me a duel-filterscript once, was the same as Nx server a while back.
I made that..! Btw if anyone still has the Nx server source, pls give! I wanna see how much i failed at scripting back then.


@Simon.: Your script is probably so great, you have to keep it for yourself. I'm guessing nobody ever made anything like it!
who's the boss? he's the boss.
Title: Re: Need Help? Ask it here!
Post by: Fuse on November 15, 2010, 03:39:24 PM
Exactly 8)
Title: Re: Need Help? Ask it here!
Post by: KmanN on November 16, 2010, 01:25:47 AM
I remember KmanN sending me a duel-filterscript once, was the same as Nx server a while back.
I made that..! Btw if anyone still has the Nx server source, pls give! I wanna see how much i failed at scripting back then.


@Simon.: Your script is probably so great, you have to keep it for yourself. I'm guessing nobody ever made anything like it!
only if you ask nicely for it slice.
Title: Re: Need Help? Ask it here!
Post by: Slice on November 16, 2010, 08:52:06 AM
pweeeeeeease
Title: Re: Need Help? Ask it here!
Post by: AJP on November 16, 2010, 09:46:44 PM


fuck you kmann
Title: Re: Need Help? Ask it here!
Post by: [Cheetos] on November 21, 2010, 08:17:30 PM
can u explain us how to make christmas tree?!<<<< iz noob men :(
Title: Re: Need Help? Ask it here!
Post by: Fuse on November 22, 2010, 11:02:11 AM
MTA 1.0 (http://www.filefront.com/thankyou.php?f=4675033)
Best map editor ^
Title: Re: Need Help? Ask it here!
Post by: NiGHTM4RE on November 26, 2010, 10:18:37 PM
HALP!

Code: [Select]
public OnFilterScriptInit()
{
     CreatePickup(1240, 2, -551.6004, 2609.5679, 66.8359, 0);
     CreatePickup(1242, 2, -551.6616, 2607.9106, 66.8359, 0);
     return 1;
}

What I wanted it to do: Create a health and armor pickup and respawn after sometime it was picked up.

What it did:The armor respawns fine but the health doesn't(first CreatePickup).

So what is wrong? Do I need another return value? And yes, I'm a noob at this and im just starting to learn it.
Title: Re: Need Help? Ask it here!
Post by: Simon on November 26, 2010, 10:53:49 PM
It seems to be related to this SA:MP bug (http://forum.sa-mp.com/showthread.php?t=124330), just create a dummy pickup before your other ones.
Code: [Select]
public OnFilterScriptInit()
{
     // This will not be able to be picked up by normal players.
     CreatePickup(1253, 0, -133333.7, -133333.7, -133333.7, -1);

     // All your pickups from here onwards
     CreatePickup(1240, 2, -551.6004,2609.5679,66.8359, 0);
     CreatePickup(1242, 2, -551.6616, 2607.9106, 66.8359, 0);

     return 1;
}

If that still doesn't solve it, then try using the pickup types 15 and 22. They have the same effect as type 2, if it still fails then you may have to script the pickup to respawn.
Title: Re: Need Help? Ask it here!
Post by: NiGHTM4RE on November 26, 2010, 11:01:06 PM
Ohh thanks, that worked. :)
Title: Re: Need Help? Ask it here!
Post by: Bikerr on February 01, 2012, 02:31:07 PM
Hey guy's, I'm trying to gain some scripting knowledge, but I've runned into a wall already.

First thing tut's say me to do, is creating a testing server. So ive configured my SFG file (filled in the hostname, pass, and the gamemode), started up pawno, clicked on New File, saved it to gamemodes... and then there's a prob.

When i click the compile button for the first time, it asks where to save it, so i save it to gamemodes. Right after clicking ok, it starts up sa:mp. Sa:mp cant connect to the server (port :7777), so i close it, then i notice that the compile window from pawno is empty (u know, that pop up window when u hit Compile). My saved file hasn't been compiled to an AMX file apparently. So, I click compile again, just compile, not compile and run, but it starts up samp again. Same problem, cant connect... Checked my SFG file again, made sure the gamemode was named after my new saved gamemode, and tried a few more times. Just won't work :/

I think it's my fault somehow, but can't figure what I did wrong.


please help! My goal is to eventually help develop LW, but I'm failing allrdy -.-


Greetz,
Bikerr
Title: Re: Need Help? Ask it here!
Post by: [eVo]PvtBenny on February 01, 2012, 02:33:56 PM
You need to openup a port in your router i think ? Correct me if im wrong though.
Title: Re: Need Help? Ask it here!
Post by: Bikerr on February 01, 2012, 02:39:14 PM
Why do they alway's leave importand info out of tut's I wonder o.-

Thanks Wild, I'll check it
Title: Re: Need Help? Ask it here!
Post by: Habdel on February 01, 2012, 03:46:28 PM
Hey guy's, I'm trying to gain some scripting knowledge, but I've runned into a wall already.

First thing tut's say me to do, is creating a testing server. So ive configured my SFG file (filled in the hostname, pass, and the gamemode), started up pawno, clicked on New File, saved it to gamemodes... and then there's a prob.

When i click the compile button for the first time, it asks where to save it, so i save it to gamemodes. Right after clicking ok, it starts up sa:mp. Sa:mp cant connect to the server (port :7777), so i close it, then i notice that the compile window from pawno is empty (u know, that pop up window when u hit Compile). My saved file hasn't been compiled to an AMX file apparently. So, I click compile again, just compile, not compile and run, but it starts up samp again. Same problem, cant connect... Checked my SFG file again, made sure the gamemode was named after my new saved gamemode, and tried a few more times. Just won't work :/

I think it's my fault somehow, but can't figure what I did wrong.


please help! My goal is to eventually help develop LW, but I'm failing allrdy -.-


Greetz,
Bikerr
maybe you havent closed the line with a "}" or a "return 1;" or a "return 0;"
Title: Re: Need Help? Ask it here!
Post by: Bikerr on February 01, 2012, 05:04:16 PM
Well I haven't wrote any script yet, just the default u get when u click on 'New File' in Pawno. But that's basicly an empty server right? It should work :/
Title: Re: Need Help? Ask it here!
Post by: Faraday on February 01, 2012, 05:09:36 PM
Try starting the server with a script that comes with the server bundle. I don't know what the new.pwn file gives when you click "new" since I don't use pawno to write code.
There's a few basic stuff like main{ } that your script needs to contain in order for the compiler to properly compile it.
Title: Re: Need Help? Ask it here!
Post by: PawnFox on February 01, 2012, 05:39:01 PM
ohai  ;D

there is new.pwn
Code: [Select]
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

#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);
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)
{
return 1;
}

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;
}

If you want run new.pwn as an gamemode, just delete al codes from #if defined FILTERSCRIPT to #endif and compile it ...
Title: Re: Need Help? Ask it here!
Post by: Bikerr on February 01, 2012, 06:06:00 PM
Hmm, I think my problems are caused by an error in the pawno program. It says "unable to compile" everytime.
Even when I delete what Pawnfox just said.

btw, I should save it in the gamemode map that's in the server package right? not somewhere in the GTA SA map?


Code: [Select]
echo Executing Server Config...
lanmode 0
rcon_password 11211
maxplayers 32
port 7777
hostname SA-MP 0.3 Bikerr's Sandbox
gamemode0 Test 1
filterscripts baseaf gl_actions gl_property gl_realtime gl_mapicon ls_elevator
announce 0
query 1
weburl www.sa-mp.com
onfoot_rate 40
incar_rate 40
weapon_rate 40
stream_distance 300.0
stream_rate 1000
maxnpc 0
logtimeformat [%H:%M:%S]

Code: [Select]
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

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);
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)
{
return 1;
}

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;
}

This is what I've got...
Title: Re: Need Help? Ask it here!
Post by: PawnFox on February 01, 2012, 06:29:53 PM
For exemple.

Save that code in Server Folder/Gamemodes as test.pwn, then run the server ...
Title: Re: Need Help? Ask it here!
Post by: Bikerr on February 01, 2012, 06:45:26 PM
Doesn't work either, and btw it needs to be an AMX file right? otherwise it won't load.

Btw, do u need to start the script through Pawno, or with the samp-server.exe file..? When I try samp-server.exe, a pop up shows for les then a second, and disappears again. :/

please check if my SFG file is ok, posted in the previous post.

Man, hate it when things don't work as they should:/


Thanks for all your help and hints so far guys, appreciate :)
Title: Re: Need Help? Ask it here!
Post by: PawnFox on February 01, 2012, 06:55:42 PM
Well, in the SA-MP Server Folder its a doccument called server_log, show us what is it in.
Title: Re: Need Help? Ask it here!
Post by: Bikerr on February 01, 2012, 07:16:54 PM
Code: [Select]
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:01:13] Error: Your password must be changed from the default password, please change it.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:10:54]
[14:10:54] Server Plugins
[14:10:54] --------------
[14:10:54]  Loaded 0 plugins.

[14:10:54]
[14:10:54] Filterscripts
[14:10:54] ---------------
[14:10:54]   Loading filterscript 'baseaf.amx'...
[14:10:54]
--Base FS loaded.

[14:10:54]   Loading filterscript 'gl_actions.amx'...
[14:10:54]   Loading filterscript 'gl_property.amx'...
[14:10:54]
-----------------------------------
[14:10:54] Grand Larceny Property Filterscript
[14:10:54] -----------------------------------

[14:10:54]   Loading filterscript 'gl_realtime.amx'...
[14:10:54]   Loading filterscript 'gl_mapicon.amx'...
[14:10:54]   Loading filterscript 'ls_elevator.amx'...
[14:10:54]   Loaded 6 filterscripts.

[14:10:54] Loaded 3 vehicles from: vehicles/trains.txt
[14:10:54] Loaded 3 vehicles from: vehicles/pilots.txt
[14:10:54] Loaded 15 vehicles from: vehicles/lv_law.txt
[14:10:54] Loaded 39 vehicles from: vehicles/lv_airport.txt
[14:10:54] Loaded 255 vehicles from: vehicles/lv_gen.txt
[14:10:54] Loaded 38 vehicles from: vehicles/sf_law.txt
[14:10:54] Loaded 35 vehicles from: vehicles/sf_airport.txt
[14:10:54] Loaded 353 vehicles from: vehicles/sf_gen.txt
[14:10:54] Loaded 24 vehicles from: vehicles/ls_law.txt
[14:10:54] Loaded 37 vehicles from: vehicles/ls_airport.txt
[14:10:54] Loaded 98 vehicles from: vehicles/ls_gen_inner.txt
[14:10:54] Loaded 389 vehicles from: vehicles/ls_gen_outer.txt
[14:10:54] Loaded 71 vehicles from: vehicles/whetstone.txt
[14:10:54] Loaded 168 vehicles from: vehicles/bone.txt
[14:10:54] Loaded 61 vehicles from: vehicles/flint.txt
[14:10:54] Loaded 96 vehicles from: vehicles/tierra.txt
[14:10:54] Loaded 96 vehicles from: vehicles/red_county.txt
[14:10:54] Total vehicles from files: 1781
[14:10:54] Reading File: blank
[14:10:54] Reading File: properties/houses.txt
[14:10:54] Reading File: properties/businesses.txt
[14:10:54] Reading File: properties/banks.txt
[14:10:54] Reading File: properties/police.txt
[14:10:54]
---------------------------------------
[14:10:54] Running Grand Larceny - by the SA-MP team

[14:10:54] ---------------------------------------

[14:10:54] Number of vehicle models: 173
[14:11:33] --- Server Shutting Down.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:19:12]
[14:19:12] Server Plugins
[14:19:12] --------------
[14:19:12]  Loaded 0 plugins.

[14:19:12] I couldn't load any gamemode scripts. Please verify your server.cfg
[14:19:12] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:19:16]
[14:19:16] Server Plugins
[14:19:16] --------------
[14:19:16]  Loaded 0 plugins.

[14:19:17] I couldn't load any gamemode scripts. Please verify your server.cfg
[14:19:17] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:19:17]
[14:19:17] Server Plugins
[14:19:17] --------------
[14:19:17]  Loaded 0 plugins.

[14:19:17] I couldn't load any gamemode scripts. Please verify your server.cfg
[14:19:17] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:19:19]
[14:19:19] Server Plugins
[14:19:19] --------------
[14:19:19]  Loaded 0 plugins.

[14:19:19] I couldn't load any gamemode scripts. Please verify your server.cfg
[14:19:19] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:19:28]
[14:19:28] Server Plugins
[14:19:28] --------------
[14:19:28]  Loaded 0 plugins.

[14:19:28] I couldn't load any gamemode scripts. Please verify your server.cfg
[14:19:28] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:28:45]
[14:28:45] Server Plugins
[14:28:45] --------------
[14:28:45]  Loaded 0 plugins.

[14:28:45]
[14:28:45] Filterscripts
[14:28:45] ---------------
[14:28:45]   Loading filterscript 'baseaf.amx'...
[14:28:45]
--Base FS loaded.

[14:28:45]   Loading filterscript 'gl_actions.amx'...
[14:28:45]   Loading filterscript 'gl_property.amx'...
[14:28:45]
-----------------------------------
[14:28:45] Grand Larceny Property Filterscript
[14:28:45] -----------------------------------

[14:28:45]   Loading filterscript 'gl_realtime.amx'...
[14:28:45]   Loading filterscript 'gl_mapicon.amx'...
[14:28:45]   Loading filterscript 'ls_elevator.amx'...
[14:28:45]   Loaded 6 filterscripts.

[14:28:45] Reading File: blank
[14:28:45] Reading File: properties/houses.txt
[14:28:45] Reading File: properties/businesses.txt
[14:28:45] Reading File: properties/banks.txt
[14:28:45] Reading File: properties/police.txt
[14:28:45]
----------------------------------
[14:28:45]   Running LVDM ~MoneyGrub

[14:28:45]          Coded By
[14:28:45]             Jax
[14:28:45] ----------------------------------

[14:28:45] Number of vehicle models: 48
[14:29:10] --- Server Shutting Down.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:40:27]
[14:40:27] Server Plugins
[14:40:27] --------------
[14:40:27]  Loaded 0 plugins.

[14:40:27] I couldn't load any gamemode scripts. Please verify your server.cfg
[14:40:27] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:40:29]
[14:40:29] Server Plugins
[14:40:29] --------------
[14:40:29]  Loaded 0 plugins.

[14:40:29] I couldn't load any gamemode scripts. Please verify your server.cfg
[14:40:29] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:40:36]
[14:40:36] Server Plugins
[14:40:36] --------------
[14:40:36]  Loaded 0 plugins.

[14:40:36] I couldn't load any gamemode scripts. Please verify your server.cfg
[14:40:36] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:40:37]
[14:40:37] Server Plugins
[14:40:37] --------------
[14:40:37]  Loaded 0 plugins.

[14:40:37] I couldn't load any gamemode scripts. Please verify your server.cfg
[14:40:37] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:40:39]
[14:40:39] Server Plugins
[14:40:39] --------------
[14:40:39]  Loaded 0 plugins.

[14:40:39] I couldn't load any gamemode scripts. Please verify your server.cfg
[14:40:39] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:41:55]
[14:41:55] Server Plugins
[14:41:55] --------------
[14:41:55]  Loaded 0 plugins.

[14:41:55] I couldn't load any gamemode scripts. Please verify your server.cfg
[14:41:55] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:42:12]
[14:42:12] Server Plugins
[14:42:12] --------------
[14:42:12]  Loaded 0 plugins.

[14:42:12] I couldn't load any gamemode scripts. Please verify your server.cfg
[14:42:12] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:42:14]
[14:42:14] Server Plugins
[14:42:14] --------------
[14:42:14]  Loaded 0 plugins.

[14:42:14] I couldn't load any gamemode scripts. Please verify your server.cfg
[14:42:14] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:42:14]
[14:42:14] Server Plugins
[14:42:14] --------------
[14:42:14]  Loaded 0 plugins.

[14:42:14] I couldn't load any gamemode scripts. Please verify your server.cfg
[14:42:14] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:46:01]
[14:46:01] Server Plugins
[14:46:01] --------------
[14:46:01]  Loaded 0 plugins.

[14:46:01] I couldn't load any gamemode scripts. Please verify your server.cfg
[14:46:01] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:46:03]
[14:46:03] Server Plugins
[14:46:03] --------------
[14:46:03]  Loaded 0 plugins.

[14:46:03] I couldn't load any gamemode scripts. Please verify your server.cfg
[14:46:03] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:49:04]
[14:49:04] Server Plugins
[14:49:04] --------------
[14:49:04]  Loaded 0 plugins.

[14:49:04] I couldn't load any gamemode scripts. Please verify your server.cfg
[14:49:04] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[14:49:09]
[14:49:09] Server Plugins
[14:49:09] --------------
[14:49:09]  Loaded 0 plugins.

[14:49:09] I couldn't load any gamemode scripts. Please verify your server.cfg
[14:49:09] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[15:57:01]
[15:57:01] Server Plugins
[15:57:01] --------------
[15:57:01]  Loaded 0 plugins.

[15:57:01] I couldn't load any gamemode scripts. Please verify your server.cfg
[15:57:01] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[15:57:02]
[15:57:02] Server Plugins
[15:57:02] --------------
[15:57:02]  Loaded 0 plugins.

[15:57:02] I couldn't load any gamemode scripts. Please verify your server.cfg
[15:57:02] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[15:57:03]
[15:57:03] Server Plugins
[15:57:03] --------------
[15:57:03]  Loaded 0 plugins.

[15:57:03] I couldn't load any gamemode scripts. Please verify your server.cfg
[15:57:03] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[15:57:03]
[15:57:03] Server Plugins
[15:57:03] --------------
[15:57:03]  Loaded 0 plugins.

[15:57:03] I couldn't load any gamemode scripts. Please verify your server.cfg
[15:57:03] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[15:57:04]
[15:57:04] Server Plugins
[15:57:04] --------------
[15:57:04]  Loaded 0 plugins.

[15:57:04] I couldn't load any gamemode scripts. Please verify your server.cfg
[15:57:04] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[15:57:05]
[15:57:05] Server Plugins
[15:57:05] --------------
[15:57:05]  Loaded 0 plugins.

[15:57:05] I couldn't load any gamemode scripts. Please verify your server.cfg
[15:57:05] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[15:57:05]
[15:57:05] Server Plugins
[15:57:05] --------------
[15:57:05]  Loaded 0 plugins.

[15:57:05] I couldn't load any gamemode scripts. Please verify your server.cfg
[15:57:05] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[15:57:06]
[15:57:06] Server Plugins
[15:57:06] --------------
[15:57:06]  Loaded 0 plugins.

[15:57:07] I couldn't load any gamemode scripts. Please verify your server.cfg
[15:57:07] It needs a gamemode0 line at the very least.

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[19:40:19]
[19:40:19] Server Plugins
[19:40:19] --------------
[19:40:19]  Loaded 0 plugins.

[19:40:19] I couldn't load any gamemode scripts. Please verify your server.cfg
[19:40:19] It needs a gamemode0 line at the very least.

This is in it, i've tried to save a few times, and deleting some again.
Title: Re: Need Help? Ask it here!
Post by: Bikerr on February 01, 2012, 07:21:30 PM
srry for double post, but this has to do with it, according to the server logs:

[19:40:19] I couldn't load any gamemode scripts. Please verify your server.cfg[19:40:19] It needs a gamemode0 line at the very least.

So, I've set 'Test' as gamemode, since that's how i named my blanc test script. But duo to compiling failure it won't be made into an AMX file, and thus won't be recognized s an gamemode?

I can't put my finger on the problem :/
Title: Re: Need Help? Ask it here!
Post by: Habdel on February 01, 2012, 07:28:02 PM
Bikerr just redownload SA-MP 0.3d R2 Windows Server
maybe something is missing in pawno
http://www.sa-mp.com/download.php
Title: Re: Need Help? Ask it here!
Post by: Bikerr on February 01, 2012, 07:53:16 PM
Got it working, redownloaded it, and now i can open the samp-server.exe. wich u need to have open before compiling and starting up the server.

Thanks guys :D
Title: Re: Need Help? Ask it here!
Post by: PawnFox on February 01, 2012, 07:57:48 PM
srry for double post, but this has to do with it, according to the server logs:

[19:40:19] I couldn't load any gamemode scripts. Please verify your server.cfg[19:40:19] It needs a gamemode0 line at the very least.

So, I've set 'Test' as gamemode, since that's how i named my blanc test script. But duo to compiling failure it won't be made into an AMX file, and thus won't be recognized s an gamemode?

I can't put my finger on the problem :/


To have .amx file, you must open the gamemode (in youre case test.pwn ) and press F5 or Compile Button. Then will appear a dialog message (and if you dont get any error, the .amx file was succesfully created). Sorry for my bad explination but i'm fucking tired  ;D. I hope this helped you. Also if you dont know something, you can visit the: http://wiki.sa-mp.com/

goodluck :)
Title: Re: Need Help? Ask it here!
Post by: Bikerr on February 01, 2012, 08:02:47 PM
hmm, cheering to early.

ok, so here's the deal

I can start samp-server.exe only if i got an premade gamemode set in server.CFG, like grandlarc.amx

When I put 'gamemode0 test 1' in the CFG file I can't start up the samp-server.exe, it closes immediatly.
This happens, I think, because the test.pawn, wich is the default script i've saved using pawno, isn't compiled yet.
However, when I hit compile, it auto-starts the server immediatly, eventhough I didn't clicked that option. (there are two options to compile; Compile and Compile and Run)

So, when everytime pawno autostarts the script, it won't get compiled, and I won't get the change to start the samp-server.exe first.

It's like an circle wich can't be broken, if u get me.

Btw, when I hit compile, let the server startup (wich cant connect), shut down the server, then I read in pawno; Unable to compile test.pawn.


It doesn't make any sence to me, and ye I'm a total scripting nub, but this doesn't seem to be right...
Title: Re: Need Help? Ask it here!
Post by: Bikerr on February 01, 2012, 08:08:29 PM
Yea, I'm trying to do that Pawn, but when i press f5 it starts up the server... and the dialog is empty and it gives an error message saying; unable to compile test.pawn.

btw, in CFG file i do have to set gamemode to 'test' right? otherwise ill be loading another script right?
Title: Re: Need Help? Ask it here!
Post by: Habdel on February 01, 2012, 08:11:12 PM
Dont use test.pwn use a gamemode already made. Try to edit it, that how you learn.
anyway test.pwn has to be in gamemode folder soo the server can find it
Title: Re: Need Help? Ask it here!
Post by: Bikerr on February 01, 2012, 08:15:06 PM
Yea, u prob right Habdel, but it bother's me that I can't save and use own scripts...

btw, when I open an excisting script, must i open the .pawn to edit or the .amx?

my first thought is editing the pawn, then hit compile again, but not sure.

Thanks for all your help dudes :)
Title: Re: Need Help? Ask it here!
Post by: PawnFox on February 01, 2012, 08:24:59 PM
Yea, u prob right Habdel, but it bother's me that I can't save and use own scripts...

btw, when I open an excisting script, must i open the .pawn to edit or the .amx?

my first thought is editing the pawn, then hit compile again, but not sure.

Thanks for all your help dudes :)

Yeah, you must open the .pwn file ...

Yea, I'm trying to do that Pawn, but when i press f5 it starts up the server... and the dialog is empty and it gives an error message saying; unable to compile test.pawn.

btw, in CFG file i do have to set gamemode to 'test' right? otherwise ill be loading another script right?

Copy and paste here that error :D
Title: Re: Need Help? Ask it here!
Post by: Bikerr on February 01, 2012, 08:31:19 PM
I Can't copy it, it's on the left bottom corner of pawno. it say's 'unable to compile test.pawn' and the pop-up dialog is empty.

I'm gonna try to edit the lvdm gamemode, cuz that one starts up as it should, and it also compiles. But, it does auto-start everytime i hit compile tho

btw, anyone knows if LW's script is open for ppl to edit or something? prob not i guess :P
Title: Re: Need Help? Ask it here!
Post by: iMJets on February 01, 2012, 09:26:10 PM
btw, anyone knows if LW's script is open for ppl to edit or something? prob not i guess :P

if the files you receive are in .pwn they are editable.
if the file you receive are in .amx only they are not editable.
Title: Re: Need Help? Ask it here!
Post by: Bikerr on February 07, 2012, 10:16:01 PM
Hey guy's

So, my training server is comming along, got a problem though;

I've added an admin system FS called 0Admin, by Zh3r0.

Installed it the right way..

Only, when the server is starting up, after "connecting to server" it restarts and then it can't connect.

I think it could be 2 things,

-my main script OnPlayerConnect/OnPlayerSpawn and such are in conflict with the ones in the filterscript

-the filterscript is outdated and full of bugs... wich is prob the case since Zh3r0 stopped scripting, thus won't release new versions.

Anyway, both my MS and FS compile without errors, so... Does anyone have an idea of what I should check?

Last lines of Server_Log:

[23:07:14] Incoming connection: 192.168.1.70:4650
[23:07:14] [join] [JOKER]Bikerr has joined the server (0:192.168.1.70)


Greetz and thanks in advance;
Bikerr :)
Title: Re: Need Help? Ask it here!
Post by: Matz on February 13, 2012, 11:43:49 AM
Guys, Are these correct? I made these but they aren't working;
Code: [Select]
public update()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
        //Ping Label
        new str[256]; format(str, sizeof(str), "%d", GetPlayerPing(i));
new Text3D:label = Create3DTextLabel(str, COLOR_ORANGE, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(label, i, 0.0, 0.0, 0.7);
}
return 1;
}
Title: Re: Need Help? Ask it here!
Post by: Carolicious on March 02, 2012, 01:46:57 PM
I know this is rather old, and im sure you found a solution already, but for the records:


Guys, Are these correct? I made these but they aren't working;
Code: [Select]
public update()
{
   for(new i = 0; i < MAX_PLAYERS; i++)
   {
        //Ping Label
        new str[256]; format(str, sizeof(str), "%d", GetPlayerPing(i));
   new Text3D:label = Create3DTextLabel(str, COLOR_ORANGE, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(label, i, 0.0, 0.0, 0.7);
   }
   return 1;
}


Everytime you run this code, it'll create a new label
but you should update the old one with new text instead.


I suggest you to have a look into this:
http://wiki.sa-mp.com/wiki/UpdatePlayer3DTextLabelText (http://wiki.sa-mp.com/wiki/UpdatePlayer3DTextLabelText)


On a sidenote:
That would mean you would have to create the label at one point (lets say when the player connects), and store its ID somewhere (in an array),
then make the update function update the label text, instead of creating a new one.
and ofcourse , destroy it when the label isn't needed anymore.
Title: Re: Need Help? Ask it here!
Post by: Source on March 04, 2012, 05:14:22 PM
^ Knowledge is sexy girl, wanna do it?  8)
Title: Re: Need Help? Ask it here!
Post by: Matz on March 22, 2012, 08:06:41 AM
I know this is rather old, and im sure you found a solution already, but for the records:


Guys, Are these correct? I made these but they aren't working;
Code: [Select]
public update()
{
   for(new i = 0; i < MAX_PLAYERS; i++)
   {
        //Ping Label
        new str[256]; format(str, sizeof(str), "%d", GetPlayerPing(i));
   new Text3D:label = Create3DTextLabel(str, COLOR_ORANGE, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(label, i, 0.0, 0.0, 0.7);
   }
   return 1;
}


Everytime you run this code, it'll create a new label
but you should update the old one with new text instead.


I suggest you to have a look into this:
http://wiki.sa-mp.com/wiki/UpdatePlayer3DTextLabelText (http://wiki.sa-mp.com/wiki/UpdatePlayer3DTextLabelText)



On a sidenote:
That would mean you would have to create the label at one point (lets say when the player connects), and store its ID somewhere (in an array),
then make the update function update the label text, instead of creating a new one.
and ofcourse , destroy it when the label isn't needed anymore.

I reply late but solved thanks.
Title: Re: Need Help? Ask it here!
Post by: Habdel on December 02, 2012, 01:11:33 PM
Hello, i need some help about my derby "minigame"
soo i created 18 pickups, each time a player pickup one of those pickups, a car is created and he is thrown into it. Now i ve set a timer of 5 mins to prevent player from moving when they picked up a pickup and also to destroy the pickups to avoid others players to join after the round started. But when the timer ends, only the player that started the derby is unfrozen, all the others are still frozen but they still got the message "The Derby has started".
"TogglePlayerControllable(playerid, 1);" Doesn't work for all players
Code: [Select]
public MaxJoinTime(playerid)
{
SendClientMessageToAll(COLOR_RED, "The Derby Event has started.");

if(GetPlayerInterior(playerid) == 15)
{
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid,"~r~THE DERBY HAS STARTED!", 5000, 5);
PlayerPlaySound(playerid, 5201, 0.0, 0.0, 10.0);

//Destroying Pickups to avoid players to join after the timer finished.
DestroyPickup(V1);
DestroyPickup(V2);
DestroyPickup(V3);
DestroyPickup(V4);
DestroyPickup(V5);
DestroyPickup(V6);
DestroyPickup(V7);
DestroyPickup(V8);
DestroyPickup(V9);
DestroyPickup(V10);
DestroyPickup(V11);
DestroyPickup(V12);
DestroyPickup(V13);
DestroyPickup(V14);
DestroyPickup(V15);
DestroyPickup(V16);
DestroyPickup(V17);
DestroyPickup(V18);
}
return 1;
}

//The first pickup, the other are all the same
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == V1)
    {
    new vehicle1 = AddStaticVehicle(504,-1276.6234,1001.8982,1037.0726,95.9995,186,186); //
    LinkVehicleToInterior(vehicle1, 15);
    SetPlayerInterior(playerid, 15);
PutPlayerInVehicle(playerid, vehicle1, 0);
TogglePlayerControllable(playerid,0);
GameTextForPlayer(playerid, "~g~PLEASE WAIT FOR OTHER PLAYERS", 5000, 5);
DestroyPickup(V1);
SendClientMessage(playerid,COLOR_RED, "Please wait for other players");
    ResetPlayerWeapons(playerid);
}
I did forwarded the MaxJoinTime & it is started when a player does a cmd
with SetTimerEx(#MaxJoinTime, 300000, false, #i, playerid);//5 Mins

I hope you guys can help me
Title: Re: Need Help? Ask it here!
Post by: Faraday on December 02, 2012, 01:49:32 PM
Seems like you just toggle the playerid controllable. If you want to unfreeze all of the players you'll have to loop through all the players and search for those in the minigame and unfreeze them.


it'll probably look like this:
Code: [Select]
for( new i = 0; i < MAX_PLAYERS; i++)
{
    if( IsPlayerInMinigame[ i ] ) //==> fill in your variable/bool whatever
          TogglePlayerControllable( i, 1 );
}
Title: Re: Need Help? Ask it here!
Post by: Jellyfish on December 11, 2012, 12:37:25 PM
This may not be the correct place to post it but I'm not where else I can. I want to start learning SAMP (PAWN(?)) scripting, I have no previous experience and no idea how it's done, but I'm quite willing so throw everything you've got at me.
Title: Re: Need Help? Ask it here!
Post by: Faraday on December 11, 2012, 02:25:06 PM
http://wiki.sa-mp.com/ (http://wiki.sa-mp.com/)
Title: Re: Need Help? Ask it here!
Post by: PawnFox on December 11, 2012, 09:48:02 PM
http://wiki.sa-mp.com/ (http://wiki.sa-mp.com/)

Here and Sa-MP official forum ( tutorials ) :p
Title: Re: Need Help? Ask it here!
Post by: Talha Khan on September 15, 2016, 08:10:29 PM
Code: [Select]
dcmd_dv(playerid, params[])
{
    #pragma unused params
    new vehicleid;
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_WHITE,"SERVER: Unknown command");
    else if(!IsPlayerInVehicle(playerid, vehicleid)) return SendClientMessage(playerid,COLOR_RED,"ERROR:You Must Be In A Vehicle");
    if(IsPlayerAdmin(playerid))
if(IsPlayerInVehicle(playerid, vehicleid))
{
    SendClientMessage(playerid,COLOR_RED,"Vehicle Removed");
    return DestroyVehicle(GetPlayerVehicleID(playerid));
    }
    return 1;
}
ok so i was making some commands but got a problem all other commands are working but not this one i want to make a command like /dv to destroy vehicle only for admins so if a player use it he gets unknown command message which is fine and when an admin use it on foot he gets ERROR:You Must Be In A Vehicle and if he use it in vehicle the vehicle is removed and he gets Vehicle Removed message
i tried doing everything i know but still getting error in this i get You Must Be In A Vehicle error even if i am in vehicle
Title: Re: Need Help? Ask it here!
Post by: Jayce on September 15, 2016, 09:21:25 PM
Code: [Select]
dcmd_dv(playerid, params[])
{
    #pragma unused params
    new vehicleid;
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_WHITE,"SERVER: Unknown command");
    else if(!IsPlayerInVehicle(playerid, vehicleid)) return SendClientMessage(playerid,COLOR_RED,"ERROR:You Must Be In A Vehicle");
    if(IsPlayerAdmin(playerid))
   if(IsPlayerInVehicle(playerid, vehicleid))
   {
    SendClientMessage(playerid,COLOR_RED,"Vehicle Removed");
    return DestroyVehicle(GetPlayerVehicleID(playerid));
    }
    return 1;
}
ok so i was making some commands but got a problem all other commands are working but not this one i want to make a command like /dv to destroy vehicle only for admins so if a player use it he gets unknown command message which is fine and when an admin use it on foot he gets ERROR:You Must Be In A Vehicle and if he use it in vehicle the vehicle is removed and he gets Vehicle Removed message
i tried doing everything i know but still getting error in this i get You Must Be In A Vehicle error even if i am in vehicle


You were checking if the player is in the vehicle ID stored in the vehicleid variable (which is 0) so it always returns false. You should use IsPlayerInAnyVehicle instead.
Code: [Select]
dcmd_dv(playerid, params[])
{
    #pragma unused params


    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_WHITE,"SERVER: Unknown command");


    if(IsPlayerInAnyVehicle(playerid))
    {
        SendClientMessage(playerid,COLOR_RED,"Vehicle Removed");
        return DestroyVehicle(GetPlayerVehicleID(playerid));
    }
    else return SendClientMessage(playerid,COLOR_RED,"ERROR:You Must Be In A Vehicle");

}

edit: WYSIWYG editor sucks.

Title: Re: Need Help? Ask it here!
Post by: Talha Khan on September 15, 2016, 09:32:03 PM
Code: [Select]
dcmd_dv(playerid, params[])
{
    #pragma unused params
    new vehicleid;
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_WHITE,"SERVER: Unknown command");
    else if(!IsPlayerInVehicle(playerid, vehicleid)) return SendClientMessage(playerid,COLOR_RED,"ERROR:You Must Be In A Vehicle");
    if(IsPlayerAdmin(playerid))
   if(IsPlayerInVehicle(playerid, vehicleid))
   {
    SendClientMessage(playerid,COLOR_RED,"Vehicle Removed");
    return DestroyVehicle(GetPlayerVehicleID(playerid));
    }
    return 1;
}
ok so i was making some commands but got a problem all other commands are working but not this one i want to make a command like /dv to destroy vehicle only for admins so if a player use it he gets unknown command message which is fine and when an admin use it on foot he gets ERROR:You Must Be In A Vehicle and if he use it in vehicle the vehicle is removed and he gets Vehicle Removed message
i tried doing everything i know but still getting error in this i get You Must Be In A Vehicle error even if i am in vehicle


You were checking if the player is in the vehicle ID stored in the vehicleid variable (which is 0) so it always returns false. You should use IsPlayerInAnyVehicle instead.
Code: [Select]
dcmd_dv(playerid, params[])
{
    #pragma unused params


    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_WHITE,"SERVER: Unknown command");


    if(IsPlayerInAnyVehicle(playerid))
    {
        SendClientMessage(playerid,COLOR_RED,"Vehicle Removed");
        return DestroyVehicle(GetPlayerVehicleID(playerid));
    }
    else return SendClientMessage(playerid,COLOR_RED,"ERROR:You Must Be In A Vehicle");

}

edit: WYSIWYG editor sucks.
great thanks it worked :)