Sziasztok!Még nem rég kezdtem a scriptelést, SA:MP-re is nem rég jöttem, úgyhogy kérlek nézzétek el a hibáimat, de mondjátok is el hogy mik.Na itt a script: ZCMD-t használ(a ZCMD-t nem én csináltam, azt letöltöttem valahonnan, de nem tudom hogy honnan!) A ZCMD kód benne van a scriptben:
A [-et cseréljétek [-re, különben nem fog mûködni a script!
ZCMD-t írta: Zeex
Neont írta: lackos888(én)
[pawn]
#if defined _zcmd_included
#endinput
#endif
#define _zcmd_included
#define MAX_FUNC_NAME (32)
#define COMMAND:%1(%2) \\
forward cmd_%1(%2); \\
public cmd_%1(%2)
#define CMD:%1(%2) \\
COMMAND:%1(%2)
#define command(%1,%2,%3) \\
COMMAND:%1(%2, %3)
#define cmd(%1,%2,%3) \\
COMMAND:%1(%2, %3)
#if !defined isnull
#define isnull(%1) \\
((!(%1[0])) || (((%1[0]) == \'\\1\') && (!(%1[1]))))
#endif
forward OnPlayerCommandReceived(playerid, cmdtext[]);
forward OnPlayerCommandPerformed(playerid, cmdtext[], success);
static
bool:zcmd_g_HasOPCS = false,
bool:zcmd_g_HasOPCE = false;
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
zcmd_g_HasOPCS = funcidx(\"OnPlayerCommandReceived\") != -1;
zcmd_g_HasOPCE = funcidx(\"OnPlayerCommandPerformed\") != -1;
return CallLocalFunction(\"zcmd_OnFilterScriptInit\", \"\");
}
#if defined _ALS_OnFilterScriptInit
#undef OnFilterScriptInit
#else
#define _ALS_OnFilterScriptInit
#endif
#define OnFilterScriptInit zcmd_OnFilterScriptInit
forward zcmd_OnFilterScriptInit();
#else /*not a filterscript*/
public OnGameModeInit()
{
zcmd_g_HasOPCS = funcidx(\"OnPlayerCommandReceived\") != -1;
zcmd_g_HasOPCE = funcidx(\"OnPlayerCommandPerformed\") != -1;
if (funcidx(\"zcmd_OnGameModeInit\") != -1)
{
return CallLocalFunction(\"zcmd_OnGameModeInit\", \"\");
}
return 1;
}
#if defined _ALS_OnGameModeInit
#undef OnGameModeInit
#else
#define _ALS_OnGameModeInit
#endif
#define OnGameModeInit zcmd_OnGameModeInit
forward zcmd_OnGameModeInit();
#endif /*if defined FILTERSCRIPT*/
public OnPlayerCommandText(playerid, cmdtext[])
{
if (zcmd_g_HasOPCS && !CallLocalFunction(\"OnPlayerCommandReceived\", \"is\", playerid, cmdtext))
{
return 1;
}
new
pos,
funcname[MAX_FUNC_NAME];
while (cmdtext[++pos] > \' \')
{
funcname[pos-1] = tolower(cmdtext[pos]);
}
format(funcname, sizeof(funcname), \"cmd_%s\", funcname);
while (cmdtext[pos] == \' \') pos++;
if (!cmdtext[pos])
{
if (zcmd_g_HasOPCE)
{
return CallLocalFunction(\"OnPlayerCommandPerformed\", \"isi\", playerid, cmdtext, CallLocalFunction(funcname, \"is\", playerid, \"\\1\"));
}
return CallLocalFunction(funcname, \"is\", playerid, \"\\1\");
}
if (zcmd_g_HasOPCE)
{
return CallLocalFunction(\"OnPlayerCommandPerformed\", \"isi\", playerid, cmdtext, CallLocalFunction(funcname, \"is\", playerid, cmdtext[pos]));
}
return CallLocalFunction(funcname, \"is\", playerid, cmdtext[pos]);
}
#if defined _ALS_OnPlayerCommandText
#undef OnPlayerCommandText
#else
#define _ALS_OnPlayerCommandText
#endif
#define OnPlayerCommandText zcmd_OnPlayerCommandText
forward zcmd_OnPlayerCommandText(playerid, cmdtext[]);
#include <a_samp>
CMD:neon(playerid, params[])
{
new vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid > 0)
{
if(GetPVarInt(playerid, \"neon1\") > 0){ DestroyObject(GetPVarInt(playerid, \"neon1\")); }
if(GetPVarInt(playerid, \"neon2\") > 0){ DestroyObject(GetPVarInt(playerid, \"neon2\")); }
if(GetPVarInt(playerid, \"neon3\") > 0){ DestroyObject(GetPVarInt(playerid, \"neon3\")); }
if(GetPVarInt(playerid, \"neon4\") > 0){ DestroyObject(GetPVarInt(playerid, \"neon4\")); }
new objectid = 0;
new szin[256] = \"\";
if(sscanf(params, \"s[256]\", szin)){ return SendClientMessage(playerid, color, \"Syntax: /neon szin. Pl: /neon kek, /neon sarga, /neon zold, /neon piros, /neon feher, /neon rozsaszin\"); }
if(strfind(szin, \"kek\", true) != -1){ objectid = 18648; }
if(strfind(szin, \"sarga\", true) != -1){ objectid = 18650; }
if(strfind(szin, \"zold\", true) != -1){ objectid = 18649; }
if(strfind(szin, \"piros\", true) != -1){ objectid = 18647; }
if(strfind(szin, \"feher\", true) != -1){ objectid = 18652; }
if(strfind(szin, \"rozsaszin\", true) != -1){ objectid = 18651; }
if(objectid <= 0){ return SendClientMessage(playerid, color, \"Syntax: /neon szin. Pl: /neon kek, /neon sarga, /neon zold, /neon piros, /neon feher, /neon rozsaszin\"); }
SetPVarInt(playerid, \"neon1\", CreateObject(objectid, 0, 0, 0, 0, 0, 0));
AttachObjectToVehicle(GetPVarInt(playerid, \"neon1\"), vehicleid, 1, 0, -0.5, 0, 0, 0);
SetPVarInt(playerid, \"neon2\", CreateObject(objectid, 0, 0, 0, 0, 0, 0));
AttachObjectToVehicle(GetPVarInt(playerid, \"neon2\"), vehicleid, -1, 0, -0.5, 0, 0, 0);
SetPVarInt(playerid, \"neon3\", CreateObject(objectid, 0, 0, 0, 0, 0, 0));
AttachObjectToVehicle(GetPVarInt(playerid, \"neon3\"), vehicleid, 0, 2.64, -0.5, 0, 0, 90);
SetPVarInt(playerid, \"neon4\", CreateObject(objectid, 0, 0, 0, 0, 0, 0));
AttachObjectToVehicle(GetPVarInt(playerid, \"neon4\"), vehicleid, 0, -2.44, -0.5, 0, 0, 90);
}
return 1;
}
[/pawn]