little help please
#1

im trying to make a gate that only one player can open it

Код:
if(strcmp(cmdtext, "/zelenxo", true) == 0);
	{
	new
	pName[MAX_PLAYER_NAME];
	{
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
	{
    if(!strcmp(pName, "ZelenX"))//if players name is zelenx

	{
    new string[128];
	new movetime = MoveObject(zelen1, 1497.25000000,-699.91000000,90.79000000,2.00000000); MoveObject(zelen2, 1497.25000000,-699.91000000,101.80000000,2.00000000);
    SendClientMessage(playerid,COLOR_YELLOW, "Dobro dosao kuci ZelenX , ukucaj /zelenxc da zatvoris kapiju.");
    format(string, sizeof(string), "Object will finish moving in %d milliseconds", movetime);

	else
	{
	SendClientMessage (playerid,0xFFFF00AA,"You are not ZelenX , please fuck off this house!");
	}
	}
	}
	}
           return 1;	
           }
but i have some errors

Код:
C:\Documents and Settings\xy\Desktop\SAMP\ravens\Raven's Roleplay 0.3c\filterscripts\neon.pwn(509) : error 036: empty statement
C:\Documents and Settings\xy\Desktop\SAMP\ravens\Raven's Roleplay 0.3c\filterscripts\neon.pwn(524) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
CAN SOMEBODY TELL ME WHERE IS PROBLEM
Reply
#2

I did the same thing yesterday, fixed. :P
pawn Код:
if(strcmp(cmdtext, "/zelenxo", true) == 0);
    {
        new pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, sizeof(pName));
        if(strcmp(pName, "ZelenX", true) == 0)//if players name is zelenx
        {
            new string[128];
            new movetime = MoveObject(zelen1, 1497.25000000,-699.91000000,90.79000000,2.00000000);
            MoveObject(zelen2, 1497.25000000,-699.91000000,101.80000000,2.00000000);
            SendClientMessage(playerid, COLOR_YELLOW, "Dobro dosao kuci ZelenX , ukucaj /zelenxc da zatvoris kapiju.");
            format(string, sizeof(string), "Object will finish moving in %d milliseconds", movetime);
            SendClientMessage(playerid, 0xFFFFFFAA, string);
        }
        else
        {
            SendClientMessage(playerid, 0xFFFF00AA,"You are not ZelenX , please fuck off this house!");
        }
        return 1;
    }
Reply
#3

now i have 1 error i dont know what is that look
Quote:

C:\Documents and Settings\xy\Desktop\SAMP\ravens\Raven's Roleplay 0.3c\filterscripts\neon.pwn(509) : error 036: empty statement
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

and this 509 line starting here:

Quote:

if(strcmp(cmdtext, "/zelenxo", true) == 0);

Reply
#4

Replace
pawn Код:
if(strcmp(cmdtext, "/zelenxo", true) == 0);
with
pawn Код:
if(strcmp(cmdtext, "/zelenxo", true) == 0)
You shouldn't add semi-colons after the final bracket of an if statement.
Reply
#5

delete the ';' at the end of the statement if

After any if, else if, else statement, you don`t need any ;
Reply
#6

problem fixed thanks guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)