06.03.2014, 22:30
Okay, so I have written out a pretty sad little code that deals with gates. I basically pieced together what I saw others do for theirs and this code magically worked. Though this maybe only one of the gates I put in I'm curious as to how the hell I push it as a timer rather then a two cmd to open and close.
Yes, I know it's messy.. I'm as I said before on a different thread I'm new to pawno/this type of coding.
Tbh, I'd like to replace /open , /close with one cmd called "/go" with about a 10 second delay.
PHP код:
new LSPDgate;
PHP код:
LSPDgate = CreateObject(969, 1539.57263, -1632.32275, 12.43860, 0.00000, 0.00000, 89.44900);
PHP код:
if (strcmp("/open", cmdtext, true, 12) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 10, 1539.57263, -1632.32275, 12.43860))
{
MoveObject(LSPDgate, 1539.5726, -1625.0808, 12.4386, 6);
SendClientMessage(playerid, 0xEF994300, "The gate have been opened.");
}
return 1;
}
if (strcmp("/close", cmdtext, true, 6) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 10, 1539.57263, -1632.32275, 12.43860))
{
MoveObject(LSPDgate, 1539.57263, -1632.32275, 12.43860, 6);
SendClientMessage(playerid, 0xEF994300, "The gate have been closed.");
}
return 1;
}
Tbh, I'd like to replace /open , /close with one cmd called "/go" with about a 10 second delay.