[Help] Timers and teleports! -
BlacK_PT - 31.08.2010
Ok so I have this on top of my script:
Код:
forward FlyTimer(playerid);
forward FlyTimer2(playerid);
A bit more down where the other commands are I have this:
Код:
new gFlyTimer;
new gFlyTimer2;
public FlyTimer(playerid)
{
SetPlayerPos( playerid, 661.2751,-2402.9463,107.1575 ); //This is where you will teleport AFTER 10 seconds
GameTextForPlayer(playerid, "~g~Welcome to Italy! ~b~Have fun!", 5000, 3);
}
public FlyTimer2(playerid)
{
SetPlayerPos( playerid, 325.7861,3234.6045,58.5038 ); //This is where you will teleport AFTER 10 seconds
GameTextForPlayer(playerid, "~g~Welcome back to Fort Carson!", 5000, 3);
}
//--------------------------------------------------------------------------
//command
if( !strcmp( cmdtext, "/flytoitaly", true ))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 325.7861,3234.6045,58.5038))
{
SetPlayerPos( playerid, 1.61,34.74,1199.3 ); //This is where you go when typing the command
SetPlayerInterior( playerid, 1 );
GivePlayerMoney( playerid, -2000 )
GameTextForPlayer(playerid, "~g~You will arrive at Italy in 60 seconds", 5000, 3);
gFlyTimer = SetTimerEx( "FlyTimer", 60000, false, "i", playerid );
return true;
}
else
{
SendClientMessage(playerid,COLOR_GREY, "You are not at Fort Carson airport!");
}
}
if( !strcmp( cmdtext, "/flytofc", true ))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 661.2751,-2402.9463,107.1575))
{
SetPlayerPos( playerid, 1.61,34.74,1199.3 ); //This is where you go when typing the command
SetPlayerInterior( playerid, 1 );
GivePlayerMoney( playerid, -2000 )
GameTextForPlayer(playerid, "~g~You will arrive at Fort Carson in 60 seconds", 5000, 3);
gFlyTimer2 = SetTimerEx( "FlyTimer2", 60000, false, "i", playerid );
return true;
}
else
{
SendClientMessage(playerid,COLOR_GREY,"You are not at Italy's airport!");
}
}
And in the end I have this:
Код:
error 004: function "FlyTimer" is not implemented
error 029: invalid expression, assumed zero
error 004: function "FlyTimer2" is not implemented
error 001: expected token: ";", but found "-identifier-"
error 001: expected token: ";", but found "-identifier-"
Re: [Help] Timers and teleports! -
CyNiC - 31.08.2010
You have any defines defineds in your script?
Re: [Help] Timers and teleports! -
BlacK_PT - 31.08.2010
you mean #define?
for the timers, no...
Re: [Help] Timers and teleports! -
Paladin - 31.08.2010
What line is the code on, also provide the code.
Re: [Help] Timers and teleports! -
BlacK_PT - 31.08.2010
Quote:
Originally Posted by Paladin
What line is the code on, also provide the code.
|
the "new" codes are on line 11667
the code /flytoitaly is on line 11688
so the code I gave you is on order except the forwards that are on the first lines after the defines
Re: [Help] Timers and teleports! -
Mikkel_Pedersen - 31.08.2010
Deleted cuz u got answer, and didnt read ur last comment carefully enought
Re: [Help] Timers and teleports! -
BlacK_PT - 31.08.2010
It did like you guys said but since I have this on the start of the script after the forwards:
pawn Код:
new gFlyTimer;
new gFlyTimer2;
it gives me this warning at the end:
Код:
warning 204: symbol is assigned a value that is never used: "gFlyTimer"
warning 204: symbol is assigned a value that is never used: "gFlyTimer2"
I have the "news" for this:
pawn Код:
if( !strcmp( cmdtext, "/flytoitaly", true ))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 325.7861,3234.6045,58.5038))
{
SetPlayerPos( playerid, 1.61,34.74,1199.3 ); //This is where you go when typing the command
SetPlayerInterior( playerid, 1 );
GivePlayerMoney( playerid, -2000 );
GameTextForPlayer(playerid, "~g~You will arrive at Italy in 60 seconds", 5000, 3);
gFlyTimer = SetTimerEx( "FlyTimer", 60000, false, "i", playerid );
return true;
}
else
{
SendClientMessage(playerid,COLOR_GREY, "You are not at Fort Carson airport!");
}
}
if( !strcmp( cmdtext, "/flytofc", true ))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 661.2751,-2402.9463,107.1575))
{
SetPlayerPos( playerid, 1.61,34.74,1199.3 ); //This is where you go when typing the command
SetPlayerInterior( playerid, 1 );
GivePlayerMoney( playerid, -2000 );
GameTextForPlayer(playerid, "~g~You will arrive at Fort Carson in 60 seconds", 5000, 3);
gFlyTimer2 = SetTimerEx( "FlyTimer2", 60000, false, "i", playerid );
return true;
}
else
{
SendClientMessage(playerid,COLOR_GREY,"You are not at Italy's airport!");
}
}