05.07.2014, 11:30
no, whats wrong with this one ? you dont want to wait 5 seconds? so i will remove it no problem.
Nasim i consider u dont do the following
1st - Dont Multi Post aka Power Power post. 2nd - Learn Scripting Reffer other scripts for lines and ideas and format and stuff 3rd - SAMP Fourms is not like a servent to u... 4th - You Must try reffering the Hardtrucking GM for the Dialog Class Section... it is like adding a textdraw a big black Box and showing a dialog.. see it u'll understand have fun Regards, Onwer of TW R.Naresh |
// This command allows the player to fine himself if no cop is online
COMMAND:911(playerid, params[])
{
// Setup local variables
new bool:CopOnline = false, Msg[128], Name[24], Fine;
// Send the command to all admins so they can see it
SendAdminText(playerid, "/911", params);
if(!IsPlayerAtPolice(playerid)) SendClientMessage(playerid, 0xFF0000AA, "{FF0000}[ERROR]: {FFFFFF}You are not at the police station!");
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
if (APlayerData[playerid][PlayerClass] != ClassPolice) {
if (GetPlayerWantedLevel(playerid) >= 1) {
// Get the player's name
GetPlayerName(playerid, Name, sizeof(Name));
// Preset the message that needs to be sent to cops
format(Msg, 128, "{0000FF}[POLICE]{FFFFFF}Player {FF0000}%s{FFFFFF} as requested you to fine him.", Name);
// Check if there is at least one cop online
for (new i; i < MAX_PLAYERS; i++)
{
// Check if this player is connected
if (IsPlayerConnected(i))
{
// Check if this player is cops
if (APlayerData[i][PlayerClass] == ClassPolice)
{
// Set the flag to indicate that at least one cop is online
CopOnline = true;
// Send the cop a message to inform him who needs fine
SendClientMessage(i, 0xFFFFFFFF, Msg);
}
}
}
// Check if there is at least one cop online
if (CopOnline == true)
{
// Let the player know that atleast one cop is online who can fine him
SendClientMessage(playerid, 0xFFFFFFFF, "{0000FF}[POLICE]{FFFFFF}Cops are online, called them.");
}
else // No cop is online
{
// Calculate the fine
Fine = GetPlayerWantedLevel(playerid) * DefaultFinePerStar;
// Let the wanted player pay the fine
RewardPlayer(playerid, -Fine, 0);
// Remove wanted level
SetPlayerWantedLevel(playerid, 0);
// Let the player know that he has been auto-fined
format(Msg, sizeof(Msg), "{0000FF}[POLICE]{FFFFFF}You have been auto-fined for {00FF00}$%i", Fine);
SendClientMessage(playerid, 0xFFFFFFFF, Msg);
}
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{0000FF}[POLICE]{FFFFFF}You cannot use /911 if you're not wanted.");
}
else
return 0;
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}
// Allows the player to setup a bank account, login to his bank account, or use his bank account after he logged in to his bank account
COMMAND:bank(playerid, params[])
{
// Setup local variables
new file[100], Name[24];
// Send the command to all admins so they can see it
SendAdminText(playerid, "/bank", params);
// Get the playername
if(!IsPlayerAtBank(playerid)) SendClientMessage(playerid, 0xFF0000AA, "{FF0000}[ERROR]: {FFFFFF}You are not at the bank!");
else return 0;
format(Name, sizeof(Name), APlayerData[playerid][PlayerName]);
// Construct the complete filename for this player's bank-account
format(file, sizeof(file), BankFile, Name);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player doesn't have a bank account
if (!fexist(file))
{
// Ask for a password to setup his bank account
ShowPlayerDialog(playerid, DialogBankPasswordRegister, DIALOG_STYLE_INPUT, "Enter password", "Please enter a password to register your bank account:", TXT_DialogButtonSelect, TXT_DialogButtonCancel);
}
else // The player has a bank account
{
// If the player hasn't logged in to his bank account yet
if (APlayerData[playerid][BankLoggedIn] == false)
{
// Ask for the password to login to his bank account
ShowPlayerDialog(playerid, DialogBankPasswordLogin, DIALOG_STYLE_INPUT, "Enter password", "Please enter your password to login to your bank account:", TXT_DialogButtonSelect, TXT_DialogButtonCancel);
}
else // The player has logged in to his bank account already
{
// Show the main bank menu dialog
ShowBankMenu(playerid);
}
}
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}