Skip to content

Instantly share code, notes, and snippets.

@dennorske
Created February 18, 2013 14:06
Show Gist options
  • Save dennorske/4977667 to your computer and use it in GitHub Desktop.
Save dennorske/4977667 to your computer and use it in GitHub Desktop.
test
CMD:gate(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /gate [pass]");
for(new i = 0; i < sizeof(GateInfo); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 15.0, GateInfo[i][gPosX], GateInfo[i][gPosY], GateInfo[i][gPosZ]))
{
if(strval(params) == GateInfo[i][gPassword])
{
MoveObject(GateInfo[i][gObject], GateInfo[i][gPosXM], GateInfo[i][gPosYM], GateInfo[i][gPosZM], GateInfo[i][gSpeed]);
SetTimer("movegate", 10000, false)//will start "movegate" function in 10 seconds. false tells that it wont be repeating.
}
else return SendClientMessage(playerid, COLOR_GREY, "Incorrect password.");
}
}
return 1;
}
forward movegate(playerid;
public movegate(playerid)
{
MoveObject(GateInfo[i][gObject], GateInfo[i][gPosX], GateInfo[i][gPosY], GateInfo[i][gPosZ], GateInfo[i][gSpeed]);
SendClientMessage(playerid, -1, "Gate closing!");
return 1;
}
//something like this i guess :P
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment