24.11.2011, 10:59
Hello, I am trying to make a moving gate that moves when doing /gate hellsangels
The "hellsangels" at the end is a password for the gate.
Errors:
Script:
The "hellsangels" at the end is a password for the gate.
Errors:
Код:
D:\Intense Roleplay\gamemodes\Gatetest.pwn(194) : warning 219: local variable "password" shadows a variable at a preceding level D:\Intense Roleplay\gamemodes\Gatetest.pwn(238) : error 010: invalid function or declaration D:\Intense Roleplay\gamemodes\Gatetest.pwn(241) : error 010: invalid function or declaration D:\Intense Roleplay\gamemodes\Gatetest.pwn(243) : error 010: invalid function or declaration D:\Intense Roleplay\gamemodes\Gatetest.pwn(244) : error 010: invalid function or declaration D:\Intense Roleplay\gamemodes\Gatetest.pwn(245) : error 010: invalid function or declaration D:\Intense Roleplay\gamemodes\Gatetest.pwn(246) : error 010: invalid function or declaration D:\Intense Roleplay\gamemodes\Gatetest.pwn(248) : error 010: invalid function or declaration D:\Intense Roleplay\gamemodes\Gatetest.pwn(254) : error 010: invalid function or declaration D:\Intense Roleplay\gamemodes\Gatetest.pwn(261) : error 010: invalid function or declaration D:\Intense Roleplay\gamemodes\Gatetest.pwn(265) : warning 203: symbol is never used: "Gate" D:\Intense Roleplay\gamemodes\Gatetest.pwn(265) : warning 203: symbol is never used: "IsOpened" D:\Intense Roleplay\gamemodes\Gatetest.pwn(265) : warning 203: symbol is never used: "password" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 9 Errors.
PHP код:
new Gate,
bool:IsOpened,
password[24] = "hellsangels";
Gate = CreateObject(969,1504.50000000,-699.70001221,93.80000305,0.00000000,0.00000000,180.00000000); //object(electricgate) (1)
IsOpened = false; //set it's status to closed
if(!strcmp("/gate",cmdtext,true))
{
if(!IsPlayerInRangeOfPoint(playerid,10.0,x,y,z)) return SendClientMessage(playerid,-1, "You aren't near any gate!");//replace with your gate x,y,z
if(strlen(cmdtext) < 7) return SendClientMessage(playerid,-1,"Usage: /gate [password]");
if(strcmp(cmdtext[7],password,true)) return SendClientMessage(playerid,-1,"Wrong Password!");
switch(IsOpened)
{
case true:
{
IsOpened = false;
SendClientMessage(playerid,-1,"Gate is closing!");
MoveObject(Gate,969,1504.50000000,-699.70001221); //co-ordinates of closed gate
}
case false:
{
IsOpened = true;
SendClientMessage(playerid,-1,"Gate is opening!");
MoveObject(Gate,969,1512.00000000,-699.69897461); //co-ordinates of opened gate
}
}
return 1;
}
}