if (strcmp("/a",cmd, true) == 0 || strcmp("/admin",cmd,true)==0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid,COLOR_LIGHTRED,"USAGE: /a(admin) [text]");
}
new msg = strval(tmp);
new seniormsg[128], juniormsg[128], leadmsg[128];
GetPlayerName(playerid,seniormsg,sizeof(seniormsg));
GetPlayerName(playerid,juniormsg,sizeof(juniormsg));
format(seniormsg,sizeof(seniormsg),"Senior Administrator %s: %s",seniormsg,msg);
format(juniormsg,sizeof(juniormsg),"Junior Administrator %s: %s",juniormsg,msg);
format(leadmsg,sizeof(leadmsg),"Lead Administrator %s: %s",leadmsg,msg);
if (PlayerInfo[playerid][pAdminLevel] == 1) SendAdminMessage(COLOR_LIGHTGREEN, juniormsg);
if (PlayerInfo[playerid][pAdminLevel] == 2) SendAdminMessage(COLOR_LIGHTGREEN, seniormsg);
if (PlayerInfo[playerid][pAdminLevel] == 3) SendAdminMessage(COLOR_LIGHTGREEN, leadmsg);
return 1;
}
stock SendAdminMessage(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1) if(PlayerInfo[i][pAdminLevel] > 0) SendClientMessage(i, color, string);
}
return 1;
}
if(strcmp("/givepermisson", cmd, true) == 0)
{
if(PlayerInfo[playerid][pAdminLevel] == 3)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid,COLOR_LIGHTRED,"USAGE: /givepermisson [id] [ammount]");
}
new amm[MAX_PLAYERS]; // amm = AMMount
amm = strrest(cmdtext, idx);
if (!strlen(amm)) SendClientMessage(playerid,COLOR_LIGHTRED,"USAGE: /givepermisson [id] [givepermisson]");
new id = strval(tmp);
new pid = playerid;
if(!IsPlayerConnected(id))
{
return SendClientMessage(playerid,COLOR_GRAY,"AdmCmd: This player is not online!");
}
if (PlayerInfo[id][pPermissons] < 500)
{
new amsg[100];
new victimid[MAX_PLAYERS];
GetPlayerName(id, victimid, sizeof(victimid));
format(amsg,sizeof(amsg),"AdmCmd: You have given %s %d permissons!",victimid,amm);
SendClientMessage(pid,COLOR_LIGHTBLUE,amsg);
PlayerInfo[id][pPermissons] = PlayerInfo[id][pPermissons] + amm[playerid];
PlayHintSoundAtPos(playerid);
return 1;
}
else SendClientMessage(pid,COLOR_GRAY,"AdmCmd: This player already haves too many permissons (over 100)!");
}
else
{
SendClientMessage(playerid,COLOR_GRAY,"You don't have authorization.");
return 1;
}
}
if (strcmp("/a",cmd, true) == 0 || strcmp("/admin",cmd,true)==0)
{
tmp = strtok(cmdtext,idx); new msg = strval(tmp);
if(!strlen(msg)) return SendClientMessage(playerid,COLOR_LIGHTRED,"USAGE: /a(admin) [text]");
new seniormsg[128], juniormsg[128], leadmsg[128];
GetPlayerName(playerid,seniormsg,sizeof(seniormsg));
GetPlayerName(playerid,juniormsg,sizeof(juniormsg));
format(seniormsg,sizeof(seniormsg),"Senior Administrator %s: %s",seniormsg,msg);
format(juniormsg,sizeof(juniormsg),"Junior Administrator %s: %s",juniormsg,msg);
format(leadmsg,sizeof(leadmsg),"Lead Administrator %s: %s",leadmsg,msg);
if (PlayerInfo[playerid][pAdminLevel] == 1) SendAdminMessage(COLOR_LIGHTGREEN, juniormsg);
if (PlayerInfo[playerid][pAdminLevel] == 2) SendAdminMessage(COLOR_LIGHTGREEN, seniormsg);
if (PlayerInfo[playerid][pAdminLevel] == 3) SendAdminMessage(COLOR_LIGHTGREEN, leadmsg);
return 1;
}
if(strcmp("/givepermisson", cmd, true) == 0)
{
if(PlayerInfo[playerid][pAdminLevel] == 3)
{
tmp = strtok(cmdtext,idx);
new amm[MAX_PLAYERS]; // amm = AMMount
amm = strrest(cmdtext, idx);
if (!strlen(amm)) SendClientMessage(playerid,COLOR_LIGHTRED,"USAGE: /givepermisson [id] [givepermisson]");
new id = strval(tmp);
new pid = playerid;
if(!strlen(tmp))
{
return SendClientMessage(playerid,COLOR_LIGHTRED,"USAGE: /givepermisson [id] [ammount]");
}
if(!IsPlayerConnected(id))
{
return SendClientMessage(playerid,COLOR_GRAY,"AdmCmd: This player is not online!");
}
if (PlayerInfo[id][pPermissons] < 500)
{
new amsg[100];
new victimid[MAX_PLAYERS];
GetPlayerName(id, victimid, sizeof(victimid));
format(amsg,sizeof(amsg),"AdmCmd: You have given %s %d permissons!",victimid,amm);
SendClientMessage(pid,COLOR_LIGHTBLUE,amsg);
PlayerInfo[id][pPermissons] = PlayerInfo[id][pPermissons] + amm[playerid];
PlayHintSoundAtPos(playerid);
return 1;
}
else SendClientMessage(pid,COLOR_GRAY,"AdmCmd: This player already haves too many permissons (over 100)!");
}
else
{
SendClientMessage(playerid,COLOR_GRAY,"You don't have authorization.");
return 1;
}
}
pawn Код:
|
C:\Archivos de programa\Rockstar Games\GTA San Andreas\San Fierro Harbor\0.3b\gamemodes\sanfierroharbor.pwn(1216) : error 035: argument type mismatch (argument 1)
if(!strlen(msg)) return SendClientMessage(playerid,COLOR_LIGHTRED,"USAGE: /a(admin) [text]");
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_LIGHTRED,"USAGE: /a(admin) [text]");
pawn Код:
EDIT: Check my first post again. |
if (strcmp("/a",cmd, true) == 0 || strcmp("/admin",cmd,true)==0)
{
tmp = strtok(cmdtext,idx); new msg = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_LIGHTRED,"USAGE: /a(admin) [text]");
new seniormsg[128], juniormsg[128], leadmsg[128];
GetPlayerName(playerid,seniormsg,sizeof(seniormsg));
GetPlayerName(playerid,juniormsg,sizeof(juniormsg));
GetPlayerName(playerid,leadmsg,sizeof(leadmsg));
format(seniormsg,sizeof(seniormsg),"Senior Administrator %s: %s",seniormsg,msg);
format(juniormsg,sizeof(juniormsg),"Junior Administrator %s: %s",juniormsg,msg);
format(leadmsg,sizeof(leadmsg),"Lead Administrator %s: %s",leadmsg,msg);
if (PlayerInfo[playerid][pAdminLevel] == 1) SendAdminMessage(COLOR_LIGHTGREEN, juniormsg);
if (PlayerInfo[playerid][pAdminLevel] == 2) SendAdminMessage(COLOR_LIGHTGREEN, seniormsg);
if (PlayerInfo[playerid][pAdminLevel] == 3) SendAdminMessage(COLOR_LIGHTGREEN, leadmsg);
return 1;
}
Try replacing SendAdminMessage with SendClientMessage, may not work. Looking at something else too.
EDIT: You have sscanf and zcmd? |
stock SendAdminMessage(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1) if(PlayerInfo[i][pAdminLevel] > 0) SendClientMessage(i, color, string);
}
return 1;
}
CMD:admin(playerid,params[])
{
tmp = strtok(cmdtext,idx);
new msg = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_LIGHTRED,"USAGE: /a(admin) [text]");
new seniormsg[128], juniormsg[128], leadmsg[128], Name[24];
GetPlayerName(playerid,Name,24);
format(seniormsg,sizeof(seniormsg),"Senior Administrator %s: %s",name,msg);
format(juniormsg,sizeof(juniormsg),"Junior Administrator %s: %s",name,msg);
format(leadmsg,sizeof(leadmsg),"Lead Administrator %s: %s",name,msg);
if (PlayerInfo[playerid][pAdminLevel] == 1) SendAdminMessage(COLOR_LIGHTGREEN, juniormsg);
else if (PlayerInfo[playerid][pAdminLevel] == 2) SendAdminMessage(COLOR_LIGHTGREEN, seniormsg);
else if (PlayerInfo[playerid][pAdminLevel] == 3) SendAdminMessage(COLOR_LIGHTGREEN, leadmsg);
return 1;
}
pawn Код:
|
C:\Archivos de programa\Rockstar Games\GTA San Andreas\San Fierro Harbor\0.3b\gamemodes\sanfierroharbor.pwn(1236) : error 017: undefined symbol "name"
C:\Archivos de programa\Rockstar Games\GTA San Andreas\San Fierro Harbor\0.3b\gamemodes\sanfierroharbor.pwn(1237) : error 017: undefined symbol "name"
C:\Archivos de programa\Rockstar Games\GTA San Andreas\San Fierro Harbor\0.3b\gamemodes\sanfierroharbor.pwn(1238) : error 017: undefined symbol "name"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
format(seniormsg,sizeof(seniormsg),"Senior Administrator %s: %s",name,msg);
format(juniormsg,sizeof(juniormsg),"Junior Administrator %s: %s",name,msg);
format(leadmsg,sizeof(leadmsg),"Lead Administrator %s: %s",name,msg);
format(seniormsg,sizeof(seniormsg),"Senior Administrator %s: %s",Name,msg);
format(juniormsg,sizeof(juniormsg),"Junior Administrator %s: %s",Name,msg);
format(leadmsg,sizeof(leadmsg),"Lead Administrator %s: %s",Name,msg);