new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(strcmp(name,"Don_Cage") || strcmp(name,"Don_Cage_One") || strcmp(name,"Don_Cage_Two") == 0)
{
// YOUR COMMAND
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(strcmp(name,"Don_Cage") || strcmp(name,"Don_Cage_One") || strcmp(name,"Other_Person_Two") || strcmp(name,"One_More_Three")== 0)
so if i want it to work for 3 persons i do like
pawn Код:
|
CMD:test(playerid, params[])
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(strcmp(name,"Don_Cage") || strcmp(name,"Don_Cage_One") || strcmp(name,"Other_Person_Two") || strcmp(name,"One_More_Three")== 0)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Yes. You can use the /test command");
}
else
{
SendClientMessage(playerid, 0xFFFFFFFF, "No. You can't use the /test command");
}
return 1;
}
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(strcmp(name,"Don_Cage") || strcmp(name,"Joe_Williams") || strcmp(name,"Xander_Cage") == 0)
{
if(strcmp(cmd, "/senate", true) == 0 || strcmp(cmd, "/sen", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "You are NOT part of the Senate!");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/sen)ate [Criminal Senate Annouce]");
return 1;
}
if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "[Criminal Senate]: Lead Senator (radio): %s, over.", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "[Criminal Senate]: Senior Senator (radio): %s, over.", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "[Criminal Senate]: Junior Senator (radio): %s, over.", sendername, result); }
else
{
format(string, sizeof(string), "[Unknown] [Criminal Senate] (radio): %s, over.", sendername, result);
}
ProxDetector(7.5, playerid, string,COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
SentMessage[playerid] = 1;
SendRadioMessage(5 || 6 || 8 || 13 || 14 || 15 || 16 || 17 || 18, TEAM_RADIO_COLOR, string);
SentMessage[playerid] = 0;
new y, m, d;
gettime(h,mi,s);
format(string, sizeof(string), "[%d/%d/%d](%d:%d:%d) [Criminal Senate] (radio): (%s)",d,m,y,h,mi,s, sendername, result);
RadioChatLog(string);
return 1;
}
}
return 1;
}
C:\Users\new account\Desktop\Everything and Anything\Server\Script\gamemodes\mazda.pwn(53859) : warning 217: loose indentation
C:\Users\new account\Desktop\Everything and Anything\Server\Script\gamemodes\mazda.pwn(53860) : error 017: undefined symbol "result"
C:\Users\new account\Desktop\Everything and Anything\Server\Script\gamemodes\mazda.pwn(53867) : warning 217: loose indentation
C:\Users\new account\Desktop\Everything and Anything\Server\Script\gamemodes\mazda.pwn(54161) : warning 217: loose indentation
C:\Users\new account\Desktop\Everything and Anything\Server\Script\gamemodes\mazda.pwn(54173) : error 017: undefined symbol "h"
C:\Users\new account\Desktop\Everything and Anything\Server\Script\gamemodes\mazda.pwn(54174) : error 017: undefined symbol "h"
C:\Users\new account\Desktop\Everything and Anything\Server\Script\gamemodes\mazda.pwn(54180) : warning 217: loose indentation
C:\Users\new account\Desktop\Everything and Anything\Server\Script\gamemodes\mazda.pwn(57838) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\new account\Desktop\Everything and Anything\Server\Script\gamemodes\mazda.pwn(85413) : warning 219: local variable "name" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
if(strcmp(cmd, "/senate", true) == 0 || strcmp(cmd, "/sen", true) == 0)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(strcmp(name,"Don_Cage") || strcmp(name,"Joe_Williams") || strcmp(name,"Xander_Cage") == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "You are NOT part of the Senate!");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/sen)ate [Criminal Senate Annouce]");
return 1;
}
if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "[Criminal Senate]: Lead Senator (radio): %s, over.", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "[Criminal Senate]: Senior Senator (radio): %s, over.", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "[Criminal Senate]: Junior Senator (radio): %s, over.", sendername, result); }
else
{
format(string, sizeof(string), "[Unknown] [Criminal Senate] (radio): %s, over.", sendername, result);
}
ProxDetector(7.5, playerid, string,COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
SentMessage[playerid] = 1;
SendRadioMessage(5 || 6 || 8 || 13 || 14 || 15 || 16 || 17 || 18, TEAM_RADIO_COLOR, string);
SentMessage[playerid] = 0;
new y, m, d;
gettime(h,mi,s);
format(string, sizeof(string), "[%d/%d/%d](%d:%d:%d) [Criminal Senate] (radio): (%s)",d,m,y,h,mi,s, sendername, result);
RadioChatLog(string);
return 1;
}
}
}
return 1;
}
C:\Users\new account\Desktop\Everything and Anything\Server\Script\gamemodes\mazda.pwn(54155) : warning 217: loose indentation
C:\Users\new account\Desktop\Everything and Anything\Server\Script\gamemodes\mazda.pwn(54167) : error 017: undefined symbol "h"
C:\Users\new account\Desktop\Everything and Anything\Server\Script\gamemodes\mazda.pwn(54168) : error 017: undefined symbol "h"
C:\Users\new account\Desktop\Everything and Anything\Server\Script\gamemodes\mazda.pwn(54174) : warning 217: loose indentation
C:\Users\new account\Desktop\Everything and Anything\Server\Script\gamemodes\mazda.pwn(57832) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\new account\Desktop\Everything and Anything\Server\Script\gamemodes\mazda.pwn(85407) : warning 219: local variable "name" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.