[HELP] Creating Gates - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Creating Gates (
/showthread.php?tid=90477)
[HELP] Creating Gates -
UberSocks - 08.08.2009
Made my first attempt at creating gates.
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;
}
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.
Re: [HELP] Creating Gates -
saiberfun - 08.08.2009
else if (strcmp(cmd, "/pdgate", true) == 0)
id say just delete the else O_O
dunno why it should be on the command line
and if that won't work add it again n check ur brackets
Re: [HELP] Creating Gates -
Woet - 08.08.2009
'READ THIS BEFORE POSTING! This goes for Godfather posts too!'