17.12.2010, 01:15
pawn Код:
#include <a_samp>
#include <a_players>
#include <a_objects>
#define PUTSPIKE 0x9ACD32AA
#define REMSPIKE 0xADFF2FAA
#define ERROR 0xAA3333AA
#define MAXSPIKES 30 // Max global spikes for your server.
new SpikesCount = 0;
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/createspike",cmdtext,true)==0)
{
new skin = GetPlayerSkin(playerid);
if (skin == 281 || skin == 282 || skin == 283 || skin == 288 || skin == 284
|| skin == 285 || skin == 286 || skin == 287 || skin == 265 || skin == 266
|| skin == 267 || skin == 280)
{
if (SpikesCount > MAXSPIKES) return SendClientMessage(playerid,ERROR,"ERROR: There is already too many spikes. Please remove some!");
else if(SpikesCount < MAXSPIKES)
{
new Float:X,Float:Y,Float:Z, Float:ang = GetPlayerFacingAngle(playerid,ang);
GetPlayerPos(playerid,X,Y,Z);
CreateObject(1593, X+1,Y-2,Z-0.1,ang,0,0);
SpikesCount++;
SendClientMessage(playerid,PUTSPIKE,"INFO: You have placed a spike strip at your location.");
return 1;
}
}
else return SendClientMessage(playerid,ERROR,"ERROR: You are not a police officer!");
}
return 0;
}
P.S: This is not my whole script only the most important part
P.S: It's a filterscript.
P.S EDIT: No errors nor warnings with the pawn compiler
PLEASE try to help me. And THANKS to whoever does it.