08.08.2009, 13:26
Made my first attempt at creating gates.
Here it is.
Pawn compiler crashes. Obviously. Forgive me, it's my first time.
Yes, I have defined the two gates. PD1 and PD2, but Ive only created the command for PD1. Could someone correct my code?
Thanks.
Here it is.
Код:
//******************************************* GATES ************************************************//
pd1 = CreateObject(969, 1539.631104, -1632.148315, 12.549690, 0.000000, 0.000000, -270.000001124);
pd2 = CreateObject(11327, 1589.443604, -1638.348755, 14.877016, 0.000000, 0.859436692696, -89.999981276);
//*************************************** GATE COMMANDS *******************************//
else if (strcmp(cmd, "/pdgate", true) == 0)
{
//if(!hasPermission(playerid,PER_PDACC)){ return 1;}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /pdgate [open/close]
}
else if (strcmp("open",tmp,true) == 0)
{
MoveObject(pd1, 1539.631104, -1632.148315, 16.124636, SPEED);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "MESSAGE: LSPD Gate Opened");
}
else if (strcmp("close",tmp,true) == 0)
{
MoveObject(pd1, 1539.631104, -1632.148315, 12.549690, SPEED);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "MESSAGE: LSPD Gate Opened");
}
else SendClientMessage(playerid,COLOR_LIGHTRED, "ERROR: You're not allowed to use this command");
}
return 1;
}
Yes, I have defined the two gates. PD1 and PD2, but Ive only created the command for PD1. Could someone correct my code?
Thanks.

