Help with my /stealfuel command please - 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 with my /stealfuel command please (
/showthread.php?tid=185341)
Help with my /stealfuel command please -
<Weponz> - 24.10.2010
Ok i have this under OnPlayerSpawn
Код:
public OnPlayerSpawn(playerid)
{
SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0);
}
return 1;
}
And this:
Код:
public OnPlayerEnterCheckpoint(playerid)
{
GameTextForPlayer(playerid, "~r~/stealfuel",3000,5);
SendClientMessage(playerid, RED, "Type /stealfuel To Start Stealing There Fuel!");
}
return 1;
}
public OnCheckpointEXIT(playerid, checkpointid)
{
return 1;
}
Now i also done this for the command:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/stealfuel", cmdtext, true) == 0)
{
if (IsPlayerInCheckpoint(playerid))
{
SendClientMessage(playerid, RED, "Your Currently Stealing Fuel..Remain In The Checkpoint!");
SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
}
else
{
SendClientMessage(playerid, RED, "You Have To Be In The Checkpoint To Steal Fuel!");
}
return 1;
}
Now ive done what i can,Can someone please show me how to set a timer for the fuel to refill after someone steals it,And how do i stop people stealing it when its on the timer,Also i dont think its working at all i get these errors:
Код:
C:\Users\Weponz\Desktop\Server Files\gamemodes\M-SAIF.pwn(235) : error 010: invalid function or declaration
C:\Users\Weponz\Desktop\Server Files\gamemodes\M-SAIF.pwn(237) : error 010: invalid function or declaration
C:\Users\Weponz\Desktop\Server Files\gamemodes\M-SAIF.pwn(242) : error 010: invalid function or declaration
C:\Users\Weponz\Desktop\Server Files\gamemodes\M-SAIF.pwn(246) : error 010: invalid function or declaration
C:\Users\Weponz\Desktop\Server Files\gamemodes\M-SAIF.pwn(257) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
5 Errors.
Please someone help i want players to be able to steal the fuel and if possible have a fuel count and after someone steals from a certain tank(Checkpoint) it takes 2 IRL mins for any1 to be able to steal again
Thanks in advance.
Re: Help with my /stealfuel command please -
JaTochNietDan - 24.10.2010
Count your brackets.
pawn Код:
public OnPlayerSpawn(playerid)
{
SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0);
} // That's one too extra, remove it
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
GameTextForPlayer(playerid, "~r~/stealfuel",3000,5);
SendClientMessage(playerid, RED, "Type /stealfuel To Start Stealing There Fuel!");
}// You guessed it, remove it
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/stealfuel", cmdtext, true) == 0)
{
if (IsPlayerInCheckpoint(playerid))
{
SendClientMessage(playerid, RED, "Your Currently Stealing Fuel..Remain In The Checkpoint!");
SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
}
else
{
SendClientMessage(playerid, RED, "You Have To Be In The Checkpoint To Steal Fuel!");
}
} // Missing one to close of the first if statement?
return 1;
}
Re: Help with my /stealfuel command please -
<Weponz> - 24.10.2010
Quote:
Originally Posted by JaTochNietDan
Count your brackets.
pawn Код:
public OnPlayerSpawn(playerid) { SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0); } // That's one too extra, remove it return 1; }
public OnPlayerEnterCheckpoint(playerid) { GameTextForPlayer(playerid, "~r~/stealfuel",3000,5); SendClientMessage(playerid, RED, "Type /stealfuel To Start Stealing There Fuel!"); }// You guessed it, remove it return 1; }
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/stealfuel", cmdtext, true) == 0) { if (IsPlayerInCheckpoint(playerid)) { SendClientMessage(playerid, RED, "Your Currently Stealing Fuel..Remain In The Checkpoint!"); SetPlayerScore(playerid, GetPlayerScore(playerid)+1); } else { SendClientMessage(playerid, RED, "You Have To Be In The Checkpoint To Steal Fuel!"); } } // Missing one to close of the first if statement? return 1; }
|
Thanks for the Tip..Ahh did you modify it at all?
EDIT:
Quote:
// Missing one to close of the first if statement?
|
i dont get that?? sometimes i get stupid errors and a brace fixes it :S
Re: Help with my /stealfuel command please -
JaTochNietDan - 24.10.2010
I left some comments in the code where you have syntax errors. They should be easy to understand.
Re: Help with my /stealfuel command please -
<Weponz> - 24.10.2010
Quote:
Originally Posted by JaTochNietDan
I left some comments in the code where you have syntax errors. They should be easy to understand.
|
Yes i see what you were stating i was just asking did u mod the code at all..but i checked..But thanks for the Tips always handy..