help me with this code
#1

Hmm so i have problem with this code
Code:
 if(!strcmp(cmdtext, "/opengate"))
 {
  MoveObject(Gate1, 3925.7256, 3417.4690, 27.4700, 10.0);
  return 1;
 }
 if(!strcmp(cmdtext, "/closegate"))
 {
  MoveObject(Gate1, 3925.7256, 3417.4690, 27.4700, 10.0);
  return 1;
 }
 return 0;
}
error:

Code:
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(222) : warning 225: unreachable code
Reply
#2

anyone ?
Reply
#3

SHow Your Object Code
Example CreateObject (etc
of both
close and open
Reply
#4

here :

Code:
new Gate1;
public OnGameModeInit()
{
 Gate1 = CreateObject(986, 3925.7256, 3417.4690, 27.4700, 313.4052, 0.0, 0.0);
}
public OnPlayerCommandText(playerid, cmdtext[])
{
 if(!strcmp(cmdtext, "/opengate"))
 {
  MoveObject(Gate1, 3925.7256, 3417.4690, 27.4700, 10.0);
  return 1;
 }
 if(!strcmp(cmdtext, "/closegate"))
 {
  MoveObject(Gate1, 3925.7256, 3417.4690, 27.4700, 10.0);
  return 1;
 }
 return 0;
}
Reply
#5

Give me The Close Gate X,Y,Z
Reply
#6

Try using this but use your own variables / values
pawn Code:
if (strcmp("/gate", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 10, 1275.58, -1270.28, 14.32))
        {
            if(Open == false)
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "The gate is now opening!");
                MoveObject(gate, 1275.58, -1270.28, 4.32, 2.0);
                Open = true;
                return 1;
            }
            if(Open == true)
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "The gate is now closing!");
                MoveObject(gate, 1275.58, -1270.28, 14.32, 2.0);
                Open = false;
                return 1;
            }
            return 1;
        }
        else return SendClientMessage(playerid, COLOR_RED, "You are not near the impound lot!");
    }
you will need to create the variable Open so use this
pawn Code:
new bool:Open;
Reply
#7

Easy way is there if i get close object
Reply
#8

@NewerthRoleplay

Code:
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(133) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(134) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(135) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(136) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(137) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(160) : error 017: undefined symbol "strtok"
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(160) : error 033: array must be indexed (variable "cmd")
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(163) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(164) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(165) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(166) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(167) : error 079: inconsistent return types (array & non-array)
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(170) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(171) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(172) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(173) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(174) : error 079: inconsistent return types (array & non-array)
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(177) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(178) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(179) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(180) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(181) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(182) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(183) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(185) : error 079: inconsistent return types (array & non-array)
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(188) : error 004: function "SendPlayerFormattedText" is not implemented

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
errors :S
Reply
#9

Is there a object there if not you have to make it first.
Reply
#10

Quote:
Originally Posted by Wonderweiss
View Post
@NewerthRoleplay

Code:
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(133) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(134) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(135) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(136) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(137) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(160) : error 017: undefined symbol "strtok"
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(160) : error 033: array must be indexed (variable "cmd")
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(163) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(164) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(165) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(166) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(167) : error 079: inconsistent return types (array & non-array)
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(170) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(171) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(172) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(173) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(174) : error 079: inconsistent return types (array & non-array)
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(177) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(178) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(179) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(180) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(181) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(182) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(183) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(185) : error 079: inconsistent return types (array & non-array)
C:\Users\Bojan\Desktop\samp server\LVDM\gamemodes\lvdm.pwn(188) : error 004: function "SendPlayerFormattedText" is not implemented

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
errors :S
That isn't anything to do with what I have pasted as far as I am aware, it is from the filterscript of the map I released, there is not anything special in the filterscript.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)