Ich habe ein Problem mit dcmd
normal hat alles geklappt aber jetzt nicht mehr ich weiß nicht warum
#define FILTERSCRIPT
#include <a_samp>
#if defined FILTERSCRIPT
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define COLOR_GRAD1 0xB4B5B7FF
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(goto,4,cmdtext);
dcmd(spawn, 5, cmdtext);
dcmd(skin, 4, cmdtext);
dcmd(waffe, 5, cmdtext);
dcmd(wetter, 6, cmdtext);
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
dcmd_spawn (playerid, cmd[])
{
new ModelID;
new farbe1;
new farbe2;
if (sscanf (cmd, "iii", ModelID,farbe1,farbe2))
{
SendClientMessage (playerid, COLOR_GRAD1, "Fehler: /spawn [ModelID] [Farbe 1] [Farbe 2]");
return 1;
}
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos (playerid, X, Y, Z);
GetPlayerFacingAngle (playerid, A);
new v = CreateVehicle (ModelID, X, Y, Z, A, farbe1, farbe2, 5000);
PutPlayerInVehicle (playerid, v, 0);
return 1;
}
dcmd_goto(playerid,params[])
{
new zielid;
if(sscanf(params, "u",zielid))
{
return SendClientMessage(playerid,COLOR_GRAD1,"Benutzung: /goto [ID]");
}
if(IsPlayerConnected(playerid) && !IsPlayerConnected(zielid))
{
SendClientMessage(playerid,COLOR_GRAD1,"Es existiert kein Spieler mit dieser ID");
return 1;
}
else
{
if(playerid == zielid)
{
SendClientMessage(playerid,COLOR_GRAD1,"Fehler: Du kannst dich nicht zu dir selber porten");
return 1;
}
else
{
new Float:x,Float:y,Float:z;
new Float:angle;
new interior;
new admin[MAX_PLAYER_NAME];
new string[256];
GetPlayerName(playerid,admin,sizeof(admin));
format(string,sizeof(string),"Spieler %s hat sich zu dir teleportiert",admin);
SendClientMessage(zielid,COLOR_GRAD1,string);
GetPlayerPos(zielid,x,y,z);
GetPlayerFacingAngle(zielid,angle);
interior = GetPlayerInterior(zielid);
new zielname[MAX_PLAYER_NAME];
new string2[256];
GetPlayerName(zielid,zielname,sizeof(zielname));
format(string2,sizeof(string2),"Du hast dich zu %s teleportiert",zielname);
SendClientMessage(playerid,COLOR_GRAD1,string2);
SetPlayerPos(playerid,x,y,z);
SetPlayerFacingAngle(playerid,COLOR_GRAD1);
SetPlayerInterior(playerid,interior);
return 1;
}
}
}
dcmd_skin(playerid,params[]) {
new
skin;
if(sscanf(params, "d",skin)) {
return SendClientMessage(playerid,COLOR_GRAD1,"Fehler: /skin [SkinID]");
}
SetPlayerSkin(playerid, skin);
return 1;
}
dcmd_wetter(playerid,params[]) {
new weather;
if(sscanf(params, "d",weather)) {
return SendClientMessage(playerid,COLOR_GRAD1,"Fehler: /wetter [WetterID]");
}
SetPlayerWeather(playerid, weather);
return 1;
}
dcmd_waffe(playerid,params[])
{
new waffe;
new bullets;
if(sscanf(params, "dd",waffe,bullets))
{
return SendClientMessage(playerid,COLOR_GRAD1,"Fehler: /waffe [WaffenID][Munition]");
}
if(waffe >= 1 || waffe <= 46)
{
if(bullets >= 1 || bullets <= 1000)
{
GivePlayerWeapon(playerid,waffe,bullets);
return 1;
}
else
{
SendClientMessage(playerid,COLOR_GRAD1,"Fehler: Höchstens 1000 Schuss und Mindestens 1 Schuss");
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_GRAD1,"Fehler: Diese Waffe gibt es nicht");
return 1;
}
}
Die Errors:
H:\sa-mp Server\filterscripts\dcmd.pwn(53) : error 017: undefined symbol "sscanf"
H:\sa-mp Server\filterscripts\dcmd.pwn(71) : error 017: undefined symbol "sscanf"
H:\sa-mp Server\filterscripts\dcmd.pwn(118) : error 017: undefined symbol "sscanf"
H:\sa-mp Server\filterscripts\dcmd.pwn(128) : error 017: undefined symbol "sscanf"
H:\sa-mp Server\filterscripts\dcmd.pwn(139) : error 017: undefined symbol "sscanf"
H:\sa-mp Server\filterscripts\dcmd.pwn(150) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.