Ich habe mir einen /afk, /back und einen /afklist gescriptet.
Aber wenn ich compilen will kommen nur Errors.
Aber ich verstehe nicht was ich falsch gemacht habe.
Hoffe jemand von euch kann mir weiterhelfen.
Befehle:
ocmd:afk(playerid,params[])
{
if(!IsPlayerConnected(playerid))return SendClientMessage(playerid,cool,"Du musst eingeloggt sein um AFK zu gehen!");
new afk[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
format(afk,sizeof(afk),"%s ist in den AFK-Modus gegangen!",pname);
SendClientMessageToAll(cool,afk);
TogglePlayerControllable(playerid,0);
SendClientMessage(pname,cool,"Du bist in den AFK-Modus gegangen!");
SetPVarInt(pname,"AFK",1);
return 1;
}
ocmd:back(playerid,params[])
{
if(!IsPlayerConnected(playerid))return SendClientMessage(playerid,cool,"Du bist nicht eingeloggt!");
new afk[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
format(afk,sizeof(afk),"%s ist wieder da!",pname);
SendClientMessageToAll(cool,afk);
TogglePlayerControllable(playerid,1);
SendClientMessage(pname,cool,"Du bist zurück!");
SetPVarInt(pname,"AFK",0);
return 1;
}
ocmd:afkliste(playerid,params[])
{
if(!IsPlayerConnected(playerid))return SendClientMessage(playerid,cool,"Du musst eingeloggt sein um die /afkliste aufzurufen!");
SendClientMessage(playerid,Tuerkis,"AFK Spieler:");
new i = 0, aname[256], string[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPVarInt(aname,"AFK")==1)
{
GetPlayerName(i, aname, sizeof(aname));
format(string, 256, "%s", aname);
SendClientMessage(playerid, cool, string);
return 1;
}
}
}
}
Errors:
C:\Users\Richard\Desktop\NYCR\gamemodes\NYCR.pwn(2212) : error 035: argument type mismatch (argument 1)
C:\Users\Richard\Desktop\NYCR\gamemodes\NYCR.pwn(2213) : error 035: argument type mismatch (argument 1)
C:\Users\Richard\Desktop\NYCR\gamemodes\NYCR.pwn(2226) : error 035: argument type mismatch (argument 1)
C:\Users\Richard\Desktop\NYCR\gamemodes\NYCR.pwn(2227) : error 035: argument type mismatch (argument 1)
C:\Users\Richard\Desktop\NYCR\gamemodes\NYCR.pwn(2237) : warning 219: local variable "i" shadows a variable at a preceding level
C:\Users\Richard\Desktop\NYCR\gamemodes\NYCR.pwn(2241) : error 035: argument type mismatch (argument 1)
C:\Users\Richard\Desktop\NYCR\gamemodes\NYCR.pwn(2236) : warning 204: symbol is assigned a value that is never used: "i"
C:\Users\Richard\Desktop\NYCR\gamemodes\NYCR.pwn(2236 -- 2250) : warning 209: function "ocmd_afkliste" should return a value
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.
Mfg