29.10.2011, 15:34
Ok how can i change this so that it would accept a list of players names
Manythanks.
Код:
if(IsPlayerAdmin(playerid))
if(IsPlayerAdmin(playerid))
new group//line29 to line35 public Group } [SW]BlackWidow { return 0; }//line35
public OnPlayerClickPlayer(playerid, clickedplayerid, source)//43 line { if GetPlayerName(Group) { ShowPlayerDialog(playerid,9137,DIALOG_STYLE_LIST,"Control Panel For{EBF700}Admin","{FF0000}Kick\n{FF0000}Ban\n{FF0000}Explode\n{FF0000}Burn\n{FF0000}Slap\n{FF0000}Jail\n{FF0000}UnJail\n{FF0000}Disarm\n{FF0000}Arm\n{FF0000}Ignore\n{FF0000}Freeze\n{FF0000}Unfreeze\n{FF0000}Mute\n{FF0000}Unmute\n{FF0000}Bring\n{FF0000}Goto\n{FF0000}Heal\n{FF0000}GiveArmour\n{FF0000}Kill\n{FF0000}Spawn\n{FF0000}Spectate\n{FF0000}Spectate Off\n{FF0000}GameText","Action","Cancel"); pClicked[playerid] = clickedplayerid; return 1; } return 1; }//52 line
C:\Users\GTA ONLY\Desktop\smartass\smartass.pwn(30) : error 001: expected token: ";", but found "public" C:\Users\GTA ONLY\Desktop\smartass\smartass.pwn(34) : error 010: invalid function or declaration C:\Users\GTA ONLY\Desktop\smartass\smartass.pwn(45) : warning 202: number of arguments does not match definition C:\Users\GTA ONLY\Desktop\smartass\smartass.pwn(45) : warning 202: number of arguments does not match definition C:\Users\GTA ONLY\Desktop\smartass\smartass.pwn(46) : error 001: expected token: "*then", but found "{" C:\Users\GTA ONLY\Desktop\smartass\smartass.pwn(331) : warning 203: symbol is never used: "group" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.
//Fixed size array for names.
//..
//ARRAY[ ENTRIES ] [ ENTRY SIZE ]
new group[ ] [ MAX_PLAYER_NAME ] =
{
"[SW]BlackWidow",
"anothername" ,
"yetanothername"
};
stock IsPlayerInGroup( const _:playerid )
{
//Function to check whether the playerid's name is in the newly created array.
if( IsPlayerConnected( playerid ) )
{
//If they're connected.
new szName[ MAX_PLAYER_NAME ],
bool:rVal;
//Get their name, store it in szName
GetPlayerName( playerid, szName, sizeof szName );
for( new i; i < sizeof group; i++ )
{
//Run through each entry of the group
if( !strcmp( szName, group[ i ], true ) )
{
//If their name is in it, then exit the loop and return true.
rVal = ( true );
break;
}
//If their name is not in the group, change rVal to false.
rVal = false;
}
//Return rVal.
return rVal;
}
//Return false (they're not connected)
return ( false );
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
if( IsPlayerInGroup( playerid ) )
{
//If they're in the group, show the dialog.
ShowPlayerDialog(playerid,9137,DIALOG_STYLE_LIST,"Control Panel For{EBF700}Admin","{FF0000}Kick\n{FF0000}Ban\n{FF0000}Explode\n{FF0000}Burn\n{FF0000}Slap\n{FF0000}Jail\n{FF0000}UnJail\n{FF0000}Disarm\n{FF0000}Arm\n{FF0000}Ignore\n{FF0000}Freeze\n{FF0000}Unfreeze\n{FF0000}Mute\n{FF0000}Unmute\n{FF0000}Bring\n{FF0000}Goto\n{FF0000}Heal\n{FF0000}GiveArmour\n{FF0000}Kill\n{FF0000}Spawn\n{FF0000}Spectate\n{FF0000}Spectate Off\n{FF0000}GameText","Action","Cancel");
pClicked[playerid] = clickedplayerid;
return 1;
}
return 1;
}