25.03.2011, 00:30
/admins in strcmp
if (strcmp(cmd, "/admins", true) == 0) { if(IsPlayerConnected(playerid)) { SendClientMessage(playerid, COLOR_GREEN, "|____ Online Administration Team ____|"); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] <= 5) { new admtext[64]; { if(PlayerInfo[i][pAdmin] == 5) { admtext = "Owner"; } else if(PlayerInfo[i][pAdmin] == 4) { admtext = "Co-Owner"; } else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Scripter/Developer"; } else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Senior Administrator"; } else if(PlayerInfo[i][pAdmin] == 1) { admtext = "Administrator"; } else { admtext = "Unknown Rank"; } } new onAduty[64]; { if(Aduty[i] == 1) { onAduty = "On Duty"; } else if(Aduty[i] == 0) { onAduty = "Off Duty"; } else { onAduty = "Unknown"; } } GetPlayerName(i, sendername, sizeof(sendername)); format(string, sizeof(string), "%s - %s - (%s)", admtext, sendername, onAduty); SendClientMessage(playerid, COLOR_BLUE, string); new y, m, d; new h,mi,s; getdate(y,m,d); gettime(h,mi,s); format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /Admins",d,m,y,h,mi,s,sendername); CommandLog(string); } } } SendClientMessage(playerid, COLOR_GREEN, "|____________________________________|"); } return 1; }
The hell you think your doing? This isn't script request at least attempt to make the command
|
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_RED 0xff0000ff
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_BRIGHTRED 0xFF0000AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD6 0xF0F0F0FF
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AAF
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_FADE1 0xE6E6E6E6
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_DBLUE 0x2641FEAA
#define COLOR_ALLDEPT 0xFF8282AA
#if defined FILTERSCRIPT
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 OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmd, "/admins", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GREEN, "|____ Online Administration Team ____|");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] <= 5)
{
new admtext[64];
{
if(PlayerInfo[i][pAdmin] == 5) { admtext = "Owner"; }
else if(PlayerInfo[i][pAdmin] == 4) { admtext = "Co-Owner"; }
else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Scripter/Developer"; }
else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Senior Administrator"; }
else if(PlayerInfo[i][pAdmin] == 1) { admtext = "Administrator"; }
else { admtext = "Unknown Rank"; }
}
new onAduty[64];
{
if(Aduty[i] == 1) { onAduty = "On Duty"; }
else if(Aduty[i] == 0) { onAduty = "Off Duty"; }
else { onAduty = "Unknown"; }
}
GetPlayerName(i, sendername, sizeof(sendername));
format(string, sizeof(string), "%s - %s - (%s)", admtext, sendername, onAduty);
SendClientMessage(playerid, COLOR_BLUE, string);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /Admins",d,m,y,h,mi,s,sendername);
CommandLog(string);
}
}
}
SendClientMessage(playerid, COLOR_GREEN, "|____________________________________|");
}
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
C:\Users\Alex\Desktop\Bot\filterscripts\test.pwn(117) : error 017: undefined symbol "cmd"
C:\Users\Alex\Desktop\Bot\filterscripts\test.pwn(126) : error 017: undefined symbol "PlayerInfo"
C:\Users\Alex\Desktop\Bot\filterscripts\test.pwn(126) : warning 215: expression has no effect
C:\Users\Alex\Desktop\Bot\filterscripts\test.pwn(126) : error 001: expected token: ";", but found "]"
C:\Users\Alex\Desktop\Bot\filterscripts\test.pwn(126) : error 029: invalid expression, assumed zero
C:\Users\Alex\Desktop\Bot\filterscripts\test.pwn(126) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.
117: if (strcmp(cmd, "/admins", true) == 0)
126: if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] <= 5)
Yes it is xD
Help Here: pawn Код:
pawn Код:
pawn Код:
pawn Код:
|