Skriptide soovimine
#31
Seepärast pole seda, kuna lihtsamat varjanti on väga lihtne teha. Poe välja 3d tekst, siis mingi cmdConfusedisene, mis kontrollib
Isplayerinrangeofpoint. Siis poe sees samasugune tekst, mis kuvab dialoogi,jne. Kirjastiil on natukene "imelik", kuna kirjutan telefonist.
Reply
#32
Palun aidake mul neid defineerida. Ma ise olen algaja Scripter.
Code:
C:\Users\Ain\Desktop\serverid\Christiano Ronaldo\gamemodes\sss.pwn(115) : error 017: undefined symbol "fdg"
C:\Users\Ain\Desktop\serverid\Christiano Ronaldo\gamemodes\sss.pwn(115) : error 017: undefined symbol "COLOR_GREY"
C:\Users\Ain\Desktop\serverid\Christiano Ronaldo\gamemodes\sss.pwn(116) : error 017: undefined symbol "fdgate1"
C:\Users\Ain\Desktop\serverid\Christiano Ronaldo\gamemodes\sss.pwn(117) : error 017: undefined symbol "fdgate2"
C:\Users\Ain\Desktop\serverid\Christiano Ronaldo\gamemodes\sss.pwn(119) : error 017: undefined symbol "COLOR_BLUE"
C:\Users\Ain\Desktop\serverid\Christiano Ronaldo\gamemodes\sss.pwn(120) : error 017: undefined symbol "string"
C:\Users\Ain\Desktop\serverid\Christiano Ronaldo\gamemodes\sss.pwn(120) : error 017: undefined symbol "string"
C:\Users\Ain\Desktop\serverid\Christiano Ronaldo\gamemodes\sss.pwn(120) : error 029: invalid expression, assumed zero
C:\Users\Ain\Desktop\serverid\Christiano Ronaldo\gamemodes\sss.pwn(120) : fatal error 107: too many error messages on one line

Saadan ka terve Script faili.
Code:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

new fdgate1;
new fdgate2;
---------------------------------------
new fdg;
new fdg2;
---------------------------------------
forward GateClose();
---------------------------------------
public GateClose()
{
      MoveObject(fdgate1,1811.59, -1791.36, 13.87, 2.5);
      MoveObject(fdgate2,1811.59, -1799.77, 13.87, 2.5);
      fdg = 0;
      fdg2 = 0;
      return 1;
}
---------------------------------------

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);
        fdg = 0;
        fdg2 = 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(cmdtext, "/fdgate", true))
    {
        if (IsPlayerInRangeOfPoint(playerid, 15,1811.59, -1795.36, 13.87))
        {
            if(fdg == 1 || fdg2 == 1) { SendClientMessage(playerid, COLOR_GREY, "** Gate is Already Opened"); return 1; }
            MoveObject(fdgate1,1811.59, -1782.96, 13.87,5);
            MoveObject(fdgate2,1811.59, -1808.19, 13.87,5);
            SetTimer("GateClose7", 10000, 0);
            SendClientMessage(playerid, COLOR_BLUE,"Fire Department Gate is Open and will Close in 10 seconds.");
            format(string, sizeof(string), "* %s takes his/her remote and opens a gate.", sendername);
            ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            fdg = 1;
            fdg2 = 1;
            return 1;
        }
    }

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;
}
Reply
#33
(19.08 2012, 22:01)tupsu45 Wrote:  Palun aidake mul neid defineerida. Ma ise olen algaja Scripter.
Code:
C:\Users\Ain\Desktop\serverid\Christiano Ronaldo\gamemodes\sss.pwn(115) : error 017: undefined symbol "fdg"
C:\Users\Ain\Desktop\serverid\Christiano Ronaldo\gamemodes\sss.pwn(115) : error 017: undefined symbol "COLOR_GREY"
C:\Users\Ain\Desktop\serverid\Christiano Ronaldo\gamemodes\sss.pwn(116) : error 017: undefined symbol "fdgate1"
C:\Users\Ain\Desktop\serverid\Christiano Ronaldo\gamemodes\sss.pwn(117) : error 017: undefined symbol "fdgate2"
C:\Users\Ain\Desktop\serverid\Christiano Ronaldo\gamemodes\sss.pwn(119) : error 017: undefined symbol "COLOR_BLUE"
C:\Users\Ain\Desktop\serverid\Christiano Ronaldo\gamemodes\sss.pwn(120) : error 017: undefined symbol "string"
C:\Users\Ain\Desktop\serverid\Christiano Ronaldo\gamemodes\sss.pwn(120) : error 017: undefined symbol "string"
C:\Users\Ain\Desktop\serverid\Christiano Ronaldo\gamemodes\sss.pwn(120) : error 029: invalid expression, assumed zero
C:\Users\Ain\Desktop\serverid\Christiano Ronaldo\gamemodes\sss.pwn(120) : fatal error 107: too many error messages on one line

Saadan ka terve Script faili.
Code:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

new fdgate1;
new fdgate2;
---------------------------------------
new fdg;
new fdg2;
---------------------------------------
forward GateClose();
---------------------------------------
public GateClose()
{
      MoveObject(fdgate1,1811.59, -1791.36, 13.87, 2.5);
      MoveObject(fdgate2,1811.59, -1799.77, 13.87, 2.5);
      fdg = 0;
      fdg2 = 0;
      return 1;
}
---------------------------------------

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);
        fdg = 0;
        fdg2 = 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(cmdtext, "/fdgate", true))
    {
        if (IsPlayerInRangeOfPoint(playerid, 15,1811.59, -1795.36, 13.87))
        {
            if(fdg == 1 || fdg2 == 1) { SendClientMessage(playerid, COLOR_GREY, "** Gate is Already Opened"); return 1; }
            MoveObject(fdgate1,1811.59, -1782.96, 13.87,5);
            MoveObject(fdgate2,1811.59, -1808.19, 13.87,5);
            SetTimer("GateClose7", 10000, 0);
            SendClientMessage(playerid, COLOR_BLUE,"Fire Department Gate is Open and will Close in 10 seconds.");
            format(string, sizeof(string), "* %s takes his/her remote and opens a gate.", sendername);
            ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            fdg = 1;
            fdg2 = 1;
            return 1;
        }
    }

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

Su skript ei tuvasta neid asju, undefined symbol taga.
Reply
#34
Sooviks saada mehaaniku haakimis süsteemi... Hädasti vaja,

Ettetänades gert232
Reply
#35
(20.08 2012, 16:21)gert232 Wrote:  Sooviks saada mehaaniku haakimis süsteemi... Hädasti vaja,

Ettetänades gert232
Kui su mängumood kasutab LARP baasi, siis võiksid proovida seda:
Code:
if(strcmp(cmd,"/sidu",true)==0) {
        if(IsPlayerConnected(playerid)) {
            if(PlayerInfo[playerid][pJob] == 1 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1) {
                if(IsPlayerInAnyVehicle(playerid)) {
                    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 525) {
                        if(GetPlayerState(playerid)==2) {
                            new Float:pX,Float:pY,Float:pZ;
                            GetPlayerPos(playerid,pX,pY,pZ);
                            new Float:vX,Float:vY,Float:vZ;
                            new Found=0;
                            new vid=0;
                            while((vid<MAX_VEHICLES)&&(!Found)) {
                                vid++;
                                GetVehiclePos(vid,vX,vY,vZ);
                                if ((floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid))) {
                                    Found=1;
                                    if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) {
                                        DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
                                    } else {
                                        AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
                                    }
                                }
                            }
                            if(!Found) {
                                SendClientMessage(playerid,COLOR_GRAD1,"Pole ühtegi autot läheduses!");
                            }
                        } else {
                            SendClientMessage(playerid, COLOR_GRAD1, "Sa pead olema juhiistmel!");
                            return 1;
                        }
                    } else {
                        SendClientMessage(playerid, COLOR_GRAD1, "Sa pead istuma Autovedaja sees!");
                        return 1;
                    }
                } else {
                    SendClientMessage(playerid, COLOR_GRAD1, "Sa pead istuma sõidukis!");
                    return 1;
                }
            } else {
                SendClientMessage(playerid,COLOR_GRAD1,"Sa ei ole Mehaanik/Politseinik!");
                return 1;
            }
        }
        return 1;
    }

Aga kui ei ole, siis vaata /sidu käsklus üle, siis saad aru, et kuidas see käib.
Reply
#36
Kas saaks sellist tahahaakimis skripti, et saad taha haakida nt mingi objekti, nt külviku, ja siis vajutad mingit nuppu vms, siis hakkavad vilja objektid maha tekkima vms , ning seda saaks pärast kombainiga üles võtta, ja siis kuidagi saaks teha ka põhupalle...

Selline asi on olemas küll, olen näinud, kuid ei oska ise seda teha...
Reply
#37
Vajan vilkuri FSi. Smile
~Traceur.~

[Image: Traceur_Stalker.png]


[Image: Pawno_User.png]

-
Reply
#38
VÕta netist Tongue "Samp Siren" Neid tehakse suht palju kah =)
Reply
#39
Indeed. Aga need on add-on'id. Olen proovind ZCMD'ga neid, convertind strcmp'iks, aga kui need mu scriptis, siis ükski cmd ei tööta. Big Grin
~Traceur.~

[Image: Traceur_Stalker.png]


[Image: Pawno_User.png]

-
Reply
#40
Kas keegi oskaks teha Politseile dialoogidena andmebaasi, et saab dialoogina vaadata mängija karistusi, sõidukeid, mida ta omab ja lube, lisaks ka lisada karistusi.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)