MoveDynamicObject - I fail
#1

pawn Код:
if(strcmp(cmdtext, "/dooropen", true) == 0) {
        if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pMember] == 14 || AdminDuty[playerid]==1) {
            if (PlayerToPoint(2, playerid,1550.80004883, -1691.59997559, 1722.09997559, 5.0)) {
                MoveDynamicObject(lspddoor1, 1535.80004883, -1691.59997559, 1722.09997559, 5.0);
                SendClientMessage(playerid, COLOR_BLUE,"You have opened the lobby door, please close it");
                GetPlayerName(playerid, sendername, sizeof(sendername));
                GiveNameSpace(sendername);
                format(string, sizeof(string), "* %s takes his/her remote control and opens the door.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else if (PlayerToPoint(2, playerid, 1559.50000000, -1677.80004883, 1722.09997559, 5.0)) {
                MoveDynamicObject(lspddoor2, 1544.50000000, -1677.80004883, 1722.09997559, 5.0);
                SendClientMessage(playerid, COLOR_BLUE,"LSPD door is open, please close it!");
                GetPlayerName(playerid, sendername, sizeof(sendername));
                GiveNameSpace(sendername);
                format(string, sizeof(string), "* %s takes his/her remote control and opens the door.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else if (PlayerToPoint(2, playerid, 1555.39941406, -1710.69921875, 1724.80004883, 5.0)) {
                MoveDynamicObject(lspddoor3, 1540.39941406, -1710.69921875, 1724.80004883, 5.0);
                SendClientMessage(playerid, COLOR_BLUE,"LSPD door is open, please close it!");
                GetPlayerName(playerid, sendername, sizeof(sendername));
                GiveNameSpace(sendername);
                format(string, sizeof(string), "* %s takes his/her remote control and opens the door.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else if (PlayerToPoint(2, playerid, 1560.69995117, -1714.00000000, 1724.80004883, 5.0)) {
                SetDynamicObjectRot(lspddoor4, 1555.69995117, -1714.00000000, 1724.80004883, 5.0);
                SendClientMessage(playerid, COLOR_BLUE,"LSPD door is open, please close it!");
                GetPlayerName(playerid, sendername, sizeof(sendername));
                GiveNameSpace(sendername);
                format(string, sizeof(string), "* %s takes his/her remote control and opens the door.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else {
                SendClientMessage(playerid, COLOR_GREY,"Destination is too far.");
            }
        }
        return 1;
    }

    if(strcmp(cmdtext, "/doorclose", true) == 0) {
        if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3|| PlayerInfo[playerid][pMember] == 14 || AdminDuty[playerid]==1) {
            if (PlayerToPoint(3, playerid, 1550.80004883, -1691.59997559, 1722.09997559, 0)) {
                MoveDynamicObject(lspddoor1, 1550.80004883, -1691.59997559, 1722.09997559, 0);
                SendClientMessage(playerid, COLOR_BLUE,"LSPD door is closed, thank you!");
                GetPlayerName(playerid, sendername, sizeof(sendername));
                GiveNameSpace(sendername);
                format(string, sizeof(string), "* %s takes his/her remote control and closes the door.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else if (PlayerToPoint(3, playerid, 1559.50000000, -1677.80004883, 1722.09997559, 0)) {
                MoveDynamicObject(lspddoor2, 1559.50000000, -1677.80004883, 1722.09997559, 0);
                SendClientMessage(playerid, COLOR_BLUE,"LSPD door is closed, thank you!");
                GetPlayerName(playerid, sendername, sizeof(sendername));
                GiveNameSpace(sendername);
                format(string, sizeof(string), "* %s takes his/her remote control and closes the door.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else if (PlayerToPoint(3, playerid, 1555.39941406, -1710.69921875, 1724.80004883, 0)) {
                MoveDynamicObject(lspddoor3, 1555.39941406, -1710.69921875, 1724.80004883, 0);
                SendClientMessage(playerid, COLOR_BLUE,"LSPD door is closed, thank you!");
                GetPlayerName(playerid, sendername, sizeof(sendername));
                GiveNameSpace(sendername);
                format(string, sizeof(string), "* %s takes his/her remote control and closes the door.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else if (PlayerToPoint(3, playerid, 1562.40002441, -1660.19995117, 1729.09997559, 0)) {
                 MoveDynamicObject(lspddoor4, 1562.40002441, -1660.19995117, 1729.09997559, 0);
                 GetPlayerName(playerid, sendername, sizeof(sendername));
                GiveNameSpace(sendername);
                format(string, sizeof(string), "* %s takes his/her remote control and closes the door.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else {
                SendClientMessage(playerid, COLOR_GREY,"Destination is too far.");
            }
        }
        return 1;
    }
This is what I get with that code

C:\Users\Rehab1\Documents\Name Roleplay\gamemodes\HE-RP.pwn(28082) : warning 202: number of arguments does not match definition
C:\Users\Rehab1\Documents\Name Roleplay\gamemodes\HE-RP.pwn(28090) : warning 202: number of arguments does not match definition
C:\Users\Rehab1\Documents\Name Roleplay\gamemodes\HE-RP.pwn(2809 : warning 202: number of arguments does not match definition
C:\Users\Rehab1\Documents\Name Roleplay\gamemodes\HE-RP.pwn(28123) : warning 202: number of arguments does not match definition
C:\Users\Rehab1\Documents\Name Roleplay\gamemodes\HE-RP.pwn(28131) : warning 202: number of arguments does not match definition
C:\Users\Rehab1\Documents\Name Roleplay\gamemodes\HE-RP.pwn(28139) : warning 202: number of arguments does not match definition
C:\Users\Rehab1\Documents\Name Roleplay\gamemodes\HE-RP.pwn(28147) : warning 202: number of arguments does not match definition
Reply
#2

Which streamer u r using?

Try this
pawn Код:
MoveDynamicObject( objectid, Float:X,
Float:Y, Float:Z, Float:Speed, Float:RotX =
-1000.0, Float:RotY = -1000.0, Float:RotZ =
-1000.0 )
Reply
#3

Код:
PlayerToPoint
Sigh. https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
This isnt neccessary, I already know about that function but, Just dont use it
Reply
#5

I'm pretty sure you DO need it, as it looks like you've defined the range twice in every call to your PlayerToPoint function. Then again, why would you use a slower function if a native one is available?
Reply
#6

Quote:
Originally Posted by Vince
Посмотреть сообщение
I'm pretty sure you DO need it, as it looks like you've defined the range twice in every call to your PlayerToPoint function. Then again, why would you use a slower function if a native one is available?
It does help as its faster, but, I dunno, I dont bother, I may do it though
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)