Scripting/Mapping Help
#1

Hey everyone, I've decied to try and teach myself how to do basic scripting and mapping. I'd just like to say that this is my first time every scripting and mapping anything, so I'm not 100% what I'm doing.


I tried to script a /help command but it doesn't seem to be working once I enter the game. My code is..


PHP код:
if (strcmp("/help"cmdtexttrue5) == 0)
    {
        
SendClientMessage (playerid0xFFFFFFFF"Welcome to Dill's Testing Server HELP command!");
        return 
1;
    }
    return 
0


Also after watching a few ******* videos, i've tried mapping a simple bedroom interior with a few items inside of it. I use MTA to map and the video says click, create a new map, click locations and 24/7, zoom out away somewhere into the sky and select your interior. Then start building on it.

After I did this and saved the file, and coverted it to post on my script. But, I can't find my interior I created anywhere in the game. I'm also not sure how to make an /enter /exit command to get inside it. Here is the code to my interior i converted..

PHP код:
public OnFilterScriptExit()
{
    
CreateObject(14803,61.70000076,131.10000610,1266.90002441,0.00000000,0.00000000,0.00000000); //object(bdupsnew) (1)
    
CreateObject(1491,57.90000153,130.10000610,1264.90002441,0.00000000,0.00000000,272.00000000); //object(gen_doorint01) (1)
    
CreateObject(1491,65.69999695,130.19999695,1264.90002441,0.00000000,0.00000000,271.99951172); //object(gen_doorint01) (2)
    
CreateObject(1797,61.29999924,132.50000000,1264.90002441,0.00000000,0.00000000,0.00000000); //object(swank_bed_3) (1)
    
CreateObject(2180,61.40000153,126.80000305,1264.90002441,0.00000000,0.00000000,0.00000000); //object(med_office5_desk_3) (1)
    
CreateObject(1786,62.09999847,126.69999695,1265.69995117,0.00000000,0.00000000,178.00000000); //object(swank_tv_4) (1)
    
CreateObject(2344,61.20000076,127.00000000,1265.69995117,0.00000000,0.00000000,0.00000000); //object(cj_remote) (1)
    
CreateObject(1712,64.90000153,132.10000610,1264.90002441,0.00000000,0.00000000,276.00000000); //object(kb_couch05) (1)
    
CreateObject(2707,61.79999924,134.69999695,1268.80004883,0.00000000,0.00000000,0.00000000); //object(cj_light_fit) (1)
    
CreateObject(2289,58.40000153,133.89999390,1267.19995117,0.00000000,0.00000000,86.00000000); //object(frame_2) (1)
/*
Objects converted: 10
Vehicles converted: 0
Vehicle models found: 0
----------------------
In the time this conversion took to finish the US national debt has risen by about $195.50!
*/
    
return 1
Reply
#2

your first command should have to be
pawn Код:
if (strcmp("/help", cmdtext, true, 5) == 0)
    {
        SendClientMessage (playerid, 0xFFFFFFFF, "Welcome to Dill's Testing Server HELP command!");
        return 1;
    }
//you dont need to add return 0; at the end of every command its just at the ending of the callback
and in your FS you need to get the place's interior(/interior go inside the room and do this) and get the place where you have to teleport the player by going inside the room and do /save and get the cords from Documents/GTA San Andreas/SAMP/save.log
Reply
#3

I'm still a little confused about this. I now have a full script for my server but whenever i try to log on, it won't connect and I dont know why.

Also, could someone please explain what filescripts are? Do i need both a script in pawno and a filescript to log onto my server?
Reply
#4

Filterscripts are kind of script addons
besides the main gamemode you can download filterscripts and run them on your server. filterscripts also need to be coded in pawno
and the mapping you have added should be in OnFilterScriptInIt not OnFilterScriptExit so that it can crate the objects when the script loads otherwise the script will try to create the objects when the script unloads so it will be like this
Objects Created>script unload>objects gone
Reply
#5

Are you scripting an GM or and FilterScript?
Reply
#6

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
Filterscripts are kind of script addons
besides the main gamemode you can download filterscripts and run them on your server. filterscripts also need to be coded in pawno
and the mapping you have added should be in OnFilterScriptInIt not OnFilterScriptExit so that it can crate the objects when the script loads otherwise the script will try to create the objects when the script unloads so it will be like this
Objects Created>script unload>objects gone

So you only have to have a gamemode and filterscripts arn't needed to play the game? For example, the gamemode would have the commands like /goto, /gethere and the filterscritps are where I would post things that I map and add into game?

If what I said is right does that mean I can create an interior in MTA, convert it and add it to pawno, then post it as a filterscript and post to my filterscript folder on server. Or are my interiors suppose to be scripting into the actual gamemode?
Reply
#7

Quote:
Originally Posted by Drake_Lopez
Посмотреть сообщение
Are you scripting an GM or and FilterScript?
I was trying to scrpit a gamemode with simple commands but I can't find out how to add it into my server after compiling it on pawno. If i compile it and save it as new.pwn, am i suppose to type "new.pwn 1" beside gamemode on the server file?

Also, how do I know when something is a filterscript? If all commands are under gamemode, why do we need to have filterscripts?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)