if (strcmp("/usecanon", cmdtext, true, 9) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 1, -1367.8082,-2327.3691,43.6029))
{
GivePlayerWeapon(playerid, 35, 1);
}
return 1;
}
new timertest[MAX_PLAYERS]; forward Timer1();
if (strcmp("/usecanon", cmdtext, true, 9) == 0) { if (timertest[playerid] == 0) { if (IsPlayerInRangeOfPoint(playerid, 1, -1367.8082,-2327.3691,43.6029)) { GivePlayerWeapon(playerid, 35, 1); timertest[playerid] = 1; SetTimer("Timer1", 60000, false); } } return 1; }
public Timer1() { if (timertest[playerid] == 1) { timertest[playerid = 0; } return 1; // return 1 - or mybe not.. dnt know :D }
error 017: undefined symbol "playerid"
error 017: undefined symbol "playerid"
warning 215: expression has no effect
if (timertest[playerid] == 1)
timertest[playerid = 0;
Originally Posted by Galcio
Thanks, but.. it gives be these errors:
pawn Код:
pawn Код:
|
if (timertest[playerid] == 1)
timertest[playerid] = 0;
error 017: undefined symbol "playerid"
error 017: undefined symbol "playerid"
new timertest[MAX_PLAYERS]; // on top forward Timer1(playerid); // on top // at the onplayercommandtext callback: if (strcmp("/usecanon", cmdtext, true, 9) == 0) { if (timertest[playerid] == 0) { if (IsPlayerInRangeOfPoint(playerid, 1, -1367.8082,-2327.3691,43.6029)) { GivePlayerWeapon(playerid, 35, 1); timertest[playerid] = 1; SetTimer("Timer1", 60000, false); } } return 1; } //The timer, new callback: public Timer1(playerid) { if (timertest[playerid] == 1) { timertest[playerid] = 0; } return 1; // return 1 - or mybe not.. dnt know :D }
Originally Posted by GaGlets®
Top of the script
Код:
new timertest[MAX_PLAYERS]; forward Timer1(); Код:
if (strcmp("/usecanon", cmdtext, true, 9) == 0) { if (timertest[playerid] == 0) { if (IsPlayerInRangeOfPoint(playerid, 1, -1367.8082,-2327.3691,43.6029)) { GivePlayerWeapon(playerid, 35, 1); timertest[playerid] = 1; SetTimer("Timer1", 60000, false); } } return 1; } Код:
public Timer1() { if (timertest[playerid] == 1) { timertest[playerid = 0; } return 1; // return 1 - or mybe not.. dnt know :D } |
Originally Posted by VonLeeuwen
Just a few improvements on your script, Gagletz,
Код:
new timertest[MAX_PLAYERS]; // on top forward Timer1(playerid); // on top // at the onplayercommandtext callback: if (strcmp("/usecanon", cmdtext, true, 9) == 0) { if (timertest[playerid] == 0) { if (IsPlayerInRangeOfPoint(playerid, 1, -1367.8082,-2327.3691,43.6029)) { GivePlayerWeapon(playerid, 35, 1); timertest[playerid] = 1; SetTimer("Timer1", 60000, false); } } return 1; } //The timer, new callback: public Timer1(playerid) { if (timertest[playerid] == 1) { timertest[playerid] = 0; } return 1; // return 1 - or mybe not.. dnt know :D } |
[]
new timertest[MAX_PLAYERS];
forward Timer1();
public OnFilterScriptInit(){
SetTimer("Timer1",59302,1);
return 1;
}
if (strcmp("/usecanon", cmdtext, true, 9) == 0)
{
if (timertest[playerid] == 0)
{
if (IsPlayerInRangeOfPoint(playerid, 1, -1367.8082,-2327.3691,43.6029))
{
GivePlayerWeapon(playerid, 35, 1);
timertest[playerid] = 1;
}
}
return 1;
}
public Timer1()
{
for(new playerid; playerid < MAX_PLAYERS;playerid++)
{
if (timertest[playerid] == 1)
{
timertest[playerid] = 0;
}
}
return 1;
}
if (strcmp("/bayonet", cmdtext, true, 8) == 0)
{
if (timercrifle[playerid] == 0)
{
SendClientMessage(playerid, 0xFFFFFFFF, "You have successfully reloaded your bayonet");
SendClientMessage(playerid, 0xAAAAAAAA, "(( You may only use the bayonet each every six seconds (takes 6sec to reload). ))");
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 33, 1);
timercrifle[playerid] = 1;
SetTimer("Timer2", 6000, false);
}
return 1;
}
if (strcmp("/usecanon", cmdtext, true, 9) == 0)
{
if (timertest[playerid] == 0)
{
if (IsPlayerInRangeOfPoint(playerid, 2, -1367.7334,-2329.4153,43.6167) || IsPlayerInRangeOfPoint(playerid, 2,
-1367.6199,-2325.1145,43.6338) || IsPlayerInRangeOfPoint(playerid, 2, -1367.5388,-2320.6838,43.6629) || IsPlayerInRangeOfPoint(playerid, 2, -1367.0610,-2311.0056,43.6313) || IsPlayerInRangeOfPoint(playerid, 2, -1366.9612,-2306.8826,43.5795) || IsPlayerInRangeOfPoint(playerid, 2, -1366.8689,-2302.5981,43.5999) || IsPlayerInRangeOfPoint(playerid, 2, -1360.4092,-2302.2817,43.7645) || IsPlayerInRangeOfPoint(playerid, 2, -1350.3254,-2302.6692,43.8080) ||
IsPlayerInRangeOfPoint(playerid, 2, -1340.1608,-2303.2659,43.5959) || IsPlayerInRangeOfPoint(playerid, 2, -1335.8135,-2308.0623,43.5575) || IsPlayerInRangeOfPoint(playerid, 2, -1336.5748,-2318.2117,43.5575) || IsPlayerInRangeOfPoint(playerid, 2, -1336.9384,-2328.4756,43.5575) || IsPlayerInRangeOfPoint(playerid, 2, -1341.9918,-2333.4768,43.6067) || IsPlayerInRangeOfPoint(playerid, 2, -1362.5692,-2332.3665,43.5644))
{
SendClientMessage(playerid, 0xFFFFFFFF, "This canon is ready to use.");
SendClientMessage(playerid, 0xAAAAAAAA, "(( Please, stand at a canon when you use this weapon. ))");
GivePlayerWeapon(playerid, 35, 1);
timertest[playerid] = 1;
SetTimer("Timer1", 60000, false);
}
else
{
SendClientMessage(playerid, 0xFFFFFFFF, "You are not near a canon or you have just used a canon, please let it reload.");
SendClientMessage(playerid, 0xAAAAAAAA, "(( It takes sixty seconds for a canon to reload. ))");
}
}
return 1;
}
new CmdDelay[MAX_PLAYERS];
//OnPlayerCommandText
if (strcmp("/bayonet", cmdtext, true, 8) == 0)
{
if (CmdDelay[playerid]<GetTickCount())
{
SendClientMessage(playerid, 0xFFFFFFFF, "You have successfully reloaded your bayonet");
SendClientMessage(playerid, 0xAAAAAAAA, "(( You may only use the bayonet each every six seconds (takes 6sec to reload). ))");
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 33, 1);
CmdDelay[playerid] = GetTickCount()+6000; //6000 = 6 seconds
}
return 1;
}