18.02.2010, 18:00
You're missing a couple of braces in there, also, its best to do the distance check inside the command. I have re-done it for you, make sure you understand it all though.
You were very close, just a few little things out.
You were very close, just a few little things out.
pawn Код:
#include <a_samp>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" SWAT job made by Mike.");
print("--------------------------------------\n");
return 1;
}
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/SWAT", cmdtext, true)) //changed this a little bit, this way is a bit shorter and easier (imo)
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 2492.28,2353.08,10.82))
{
SendClientMessage(playerid, 0xFFFFFFFF,"Welcome to SWAT Duty, Aid the police and keep citizens safe!");
SendClientMessage(playerid, 0xFFFFFFFF,"To be a civilian hit F4 then do /kill, Remember no DMing!");
SetPlayerColor(playerid, 4294901930);
SetPlayerSkin(playerid,285);
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, 31, 800); //M4
GivePlayerWeapon(playerid, 45, 1); //thermal goggles
GivePlayerWeapon(playerid, 34, 80); //sniper rifle
GivePlayerWeapon(playerid, 17, 80); //Teargas (thrown Version)
GivePlayerWeapon(playerid, 24, 80); //Deagle
return 1;
}
else
{
SendClientMessage(playerid,0xFF0000FF,"ERROR: You're not near the police station!"); //change this error message if you like. I don't know if it applies or not.
return 1;
}
}
return 0;
}