SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Closed Thread
 
Thread Tools Display Modes
Old 31/01/2013, 07:53 AM   #3211
andrewgrob
Huge Clucker
 
Join Date: Apr 2009
Posts: 290
Reputation: 48
Default Re: Script Request Thread #5

looking for a countdown filterscript. that starts when gamemode starts

i dont want to do /count cmd

it just automaticly starts counting down from 5 min to 0


with a textdraw showing countdown to all players

i will pay... or you can be a admin on my server


add andrewgrob2012 .. on skype or just visit my server below
andrewgrob is offline  
Old 31/01/2013, 08:08 AM   #3212
antonio112
Gangsta
 
antonio112's Avatar
 
Join Date: Aug 2009
Location: Romania
Posts: 970
Reputation: 87
Default Re: Script Request Thread #5

Quote:
Originally Posted by andrewgrob View Post
looking for a countdown filterscript. that starts when gamemode starts

i dont want to do /count cmd

it just automaticly starts counting down from 5 min to 0


with a textdraw showing countdown to all players

i will pay... or you can be a admin on my server


add andrewgrob2012 .. on skype or just visit my server below


Well, I can show you a pretty simple example, you can modify it as you please to fit your server and your requirements.

pawn Code:
new CountMinutes = 4;
new CountSeconds = 60;
new CountTimer;

OnGameModeInit()
{
    CountTimer = SetTimer("CountDown", 1000, true);
    return 1;
}

forward CountDown();
public CountDown()
{
     new str[50];
     CountSeconds --;
     if(Seconds < 1 && CountMinutes > 0)
     {
         CountSeconds = 60;
         CountMinutes --;
         format(str, sizeof str, "Time left: %d:%d", CountMinutes, CountSeconds);
         GameTextForAll(str, 1000, 1);
     }
     else if(CountSeconds < 1 && CountMinutes == 0)
     {
            KillTimer(CountTimer);
            CountMinutes = 4;
            CountSeconds = 59;
            SendClientMessageToAll(-1, "Countdown finished.");
     }
     return 1;
}

This example's with GameText... You can modify it, to make it use TextDraws, but that's up to you.
__________________
antonio112 is offline  
Old 31/01/2013, 10:29 AM   #3213
MehranGta
Big Clucker
 
Join Date: Jul 2012
Location: CA - IR
Posts: 192
Reputation: -7
Default Re: Script Request Thread #5

Hello
i need a savestats cmd for luxadmin
see this :
Code:
dcmd_resetstats(playerid,params[])
{
    #pragma unused params
	if(AccInfo[playerid][LoggedIn] == 1)
	{
	   	dUserSetINT(PlayerName2(playerid)).("oldkills",AccInfo[playerid][Kills]);
	   	dUserSetINT(PlayerName2(playerid)).("olddeaths",AccInfo[playerid][Deaths]);
		AccInfo[playerid][Kills] = 0;
		AccInfo[playerid][Deaths] = 0;
		dUserSetINT(PlayerName2(playerid)).("Kills",AccInfo[playerid][Kills]);
	   	dUserSetINT(PlayerName2(playerid)).("Deaths",AccInfo[playerid][Deaths]);
        PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
		return SendClientMessage(playerid,yellow,"|- You have Successfully reset your Stats! -|");
	}
	else return SendClientMessage(playerid,red, "ERROR: You must have an account to use this command");
}

dcmd_stats(playerid,params[])
{
	new string[128];
	new pDeaths;
	new player1, h, m, s;

	if(!strlen(params)) player1 = playerid;
	else player1 = strval(params);

	if(IsPlayerConnected(player1))
	{
    TotalGameTime(player1, h, m, s);
	if(AccInfo[player1][Deaths] == 0) pDeaths = 1;
	else pDeaths = AccInfo[player1][Deaths];
	format(string, sizeof(string), "|- %s's Statistics -|",PlayerName2(player1));
	SendClientMessage(playerid, green, string);
	format(string, sizeof(string), "Kills: [%d] | Deaths: [%d] | Ratio: [%0.2f] | Money: [$%d] | Time: [%d] hrs [%d] mins [%d] secs |", AccInfo[player1][Kills], AccInfo[player1][Deaths], Float:AccInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), h, m, s);
	return SendClientMessage(playerid, green, string);
	} else
	return SendClientMessage(playerid, red, "ERROR: Player Not Connected!");
}
these are resetstats and stats but i need savestats
tnx
gift : 2 rep
MehranGta is offline  
Old 31/01/2013, 11:23 AM   #3214
andrewgrob
Huge Clucker
 
Join Date: Apr 2009
Posts: 290
Reputation: 48
Default Re: Script Request Thread #5

Quote:
Originally Posted by antonio112 View Post
Well, I can show you a pretty simple example, you can modify it as you please to fit your server and your requirements.

pawn Code:
new CountMinutes = 4;
new CountSeconds = 60;
new CountTimer;

OnGameModeInit()
{
    CountTimer = SetTimer("CountDown", 1000, true);
    return 1;
}

forward CountDown();
public CountDown()
{
     new str[50];
     CountSeconds --;
     if(Seconds < 1 && CountMinutes > 0)
     {
         CountSeconds = 60;
         CountMinutes --;
         format(str, sizeof str, "Time left: %d:%d", CountMinutes, CountSeconds);
         GameTextForAll(str, 1000, 1);
     }
     else if(CountSeconds < 1 && CountMinutes == 0)
     {
            KillTimer(CountTimer);
            CountMinutes = 4;
            CountSeconds = 59;
            SendClientMessageToAll(-1, "Countdown finished.");
     }
     return 1;
}

This example's with GameText... You can modify it, to make it use TextDraws, but that's up to you.
thank you i will try this
andrewgrob is offline  
Old 31/01/2013, 12:44 PM   #3215
kristijan250
Little Clucker
 
Join Date: Sep 2012
Posts: 19
Reputation: 0
Default Re: Script Request Thread #5

Need suspect command in zcmd
kristijan250 is offline  
Old 31/01/2013, 02:06 PM   #3216
Hade.
Huge Clucker
 
Hade.'s Avatar
 
Join Date: Oct 2012
Location: Tallinn, Estonia
Posts: 210
Reputation: 16
Default Re: Script Request Thread #5

I need a derby system, heres my command below. I need that the limit is 4 people, i have 4 cars. And the last one in the derby, who has smashed all cars gets 10'000$, really need it.


Code:
CMD:derby(playerid, params[])
{
    new str7[128], player8[MAX_PLAYER_NAME];
    GetPlayerName(playerid, player8, sizeof(player8));
    format(str7,sizeof(str7),"%s teleportis end derbysse [/derby]",player8);
    SendClientMessageToAll(COLOR_GREEN,str7);
    new rand = random(sizeof(D1Rand));
    SetPlayerPos(playerid, D1Rand[rand][0], D1Rand[rand][1], D1Rand[rand][2]);
    SendClientMessage(playerid, COLOR_NGREEN,"Teleportisid end derbysse!");
    ResetPlayerWeapons(playerid);
    nocmd[playerid] = 1;
    return 1;
}
__________________
Hade. is offline  
Old 31/01/2013, 04:56 PM   #3217
bathushan
Huge Clucker
 
Join Date: May 2012
Location: Germany
Posts: 284
Reputation: -22
Default Re: Script Request Thread #5

Hey there....
i looking for a Script.
that looks Evelator.

( That i can places where ever i want. also a basic working Evelator . i can edit cooords-

And i need for GM script NOT for FS.

--Edit--
No needed. Found
__________________

You want a Mapper? PM me with your Server ip!

Last edited by bathushan; 31/01/2013 at 05:34 PM.
bathushan is offline  
Old 31/01/2013, 06:37 PM   #3218
MehranGta
Big Clucker
 
Join Date: Jul 2012
Location: CA - IR
Posts: 192
Reputation: -7
Default Re: Script Request Thread #5

Quote:
Originally Posted by MehranGta View Post
Hello
i need a savestats cmd for luxadmin
see this :
Code:
dcmd_resetstats(playerid,params[])
{
    #pragma unused params
	if(AccInfo[playerid][LoggedIn] == 1)
	{
	   	dUserSetINT(PlayerName2(playerid)).("oldkills",AccInfo[playerid][Kills]);
	   	dUserSetINT(PlayerName2(playerid)).("olddeaths",AccInfo[playerid][Deaths]);
		AccInfo[playerid][Kills] = 0;
		AccInfo[playerid][Deaths] = 0;
		dUserSetINT(PlayerName2(playerid)).("Kills",AccInfo[playerid][Kills]);
	   	dUserSetINT(PlayerName2(playerid)).("Deaths",AccInfo[playerid][Deaths]);
        PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
		return SendClientMessage(playerid,yellow,"|- You have Successfully reset your Stats! -|");
	}
	else return SendClientMessage(playerid,red, "ERROR: You must have an account to use this command");
}

dcmd_stats(playerid,params[])
{
	new string[128];
	new pDeaths;
	new player1, h, m, s;

	if(!strlen(params)) player1 = playerid;
	else player1 = strval(params);

	if(IsPlayerConnected(player1))
	{
    TotalGameTime(player1, h, m, s);
	if(AccInfo[player1][Deaths] == 0) pDeaths = 1;
	else pDeaths = AccInfo[player1][Deaths];
	format(string, sizeof(string), "|- %s's Statistics -|",PlayerName2(player1));
	SendClientMessage(playerid, green, string);
	format(string, sizeof(string), "Kills: [%d] | Deaths: [%d] | Ratio: [%0.2f] | Money: [$%d] | Time: [%d] hrs [%d] mins [%d] secs |", AccInfo[player1][Kills], AccInfo[player1][Deaths], Float:AccInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), h, m, s);
	return SendClientMessage(playerid, green, string);
	} else
	return SendClientMessage(playerid, red, "ERROR: Player Not Connected!");
}
these are resetstats and stats but i need savestats
tnx
gift : 2 rep

no one?
MehranGta is offline  
Old 31/01/2013, 07:42 PM   #3219
Roach_
Huge Clucker
 
Roach_'s Avatar
 
Join Date: Sep 2012
Posts: 281
Reputation: 35
Default Re: Script Request Thread #5

Quote:
Originally Posted by MehranGta View Post
no one?
This admin filterscript has a SavePlayerStats function implemented:
pawn Code:
SavePlayerStats(playerid)
{
    dUserSetINT(PlayerName2(playerid)).("Money",GetPlayerMoney(playerid));
    dUserSetINT(PlayerName2(playerid)).("Kills",AccInfo[playerid][Kills]);
    dUserSetINT(PlayerName2(playerid)).("Deaths",AccInfo[playerid][Deaths]);
    dUserSetINT(PlayerName2(playerid)).("WantedLevel",GetPlayerWantedLevel(playerid));
    #if SaveScore == true
    dUserSetINT(PlayerName2(playerid)).("Score",GetPlayerScore(playerid));
    #endif

    new h, m, s;
    TotalGameTime(playerid, h, m, s);

    dUserSetINT(PlayerName2(playerid)).("Hours", h);
    dUserSetINT(PlayerName2(playerid)).("Minutes", m);
    dUserSetINT(PlayerName2(playerid)).("Seconds", s);

    new Float:x,Float:y,Float:z, interior;
    GetPlayerPos(playerid,x,y,z);
    interior = GetPlayerInterior(playerid);
   
    dUserSetINT(PlayerName2(playerid)).("x1",floatround(x));
    dUserSetINT(PlayerName2(playerid)).("y1",floatround(y));
    dUserSetINT(PlayerName2(playerid)).("z1",floatround(z));
    dUserSetINT(PlayerName2(playerid)).("interior1",interior);

    new weap1, ammo1, weap2, ammo2, weap3, ammo3, weap4, ammo4, weap5, ammo5, weap6, ammo6;
   
    GetPlayerWeaponData(playerid,2,weap1,ammo1);
    GetPlayerWeaponData(playerid,3,weap2,ammo2);
    GetPlayerWeaponData(playerid,4,weap3,ammo3);
    GetPlayerWeaponData(playerid,5,weap4,ammo4);
    GetPlayerWeaponData(playerid,6,weap5,ammo5);
    GetPlayerWeaponData(playerid,7,weap6,ammo6);
   
    dUserSetINT(PlayerName2(playerid)).("Weapon1",weap1);
    dUserSetINT(PlayerName2(playerid)).("Weapon1Ammo",ammo1);
    dUserSetINT(PlayerName2(playerid)).("Weapon2",weap2);
    dUserSetINT(PlayerName2(playerid)).("Weapon2Ammo",ammo2);
    dUserSetINT(PlayerName2(playerid)).("Weapon3",weap3);
    dUserSetINT(PlayerName2(playerid)).("Weapon3Ammo",ammo3);
    dUserSetINT(PlayerName2(playerid)).("Weapon4",weap4);
    dUserSetINT(PlayerName2(playerid)).("Weapon4Ammo",ammo4);
    dUserSetINT(PlayerName2(playerid)).("Weapon5",weap5);
    dUserSetINT(PlayerName2(playerid)).("Weapon5Ammo",ammo5);
    dUserSetINT(PlayerName2(playerid)).("Weapon6",weap6);
    dUserSetINT(PlayerName2(playerid)).("Weapon6Ammo",ammo6);

    new Float:health;
    GetPlayerHealth(playerid, Float:health);
    new Float:armour;
    GetPlayerArmour(playerid, Float:armour);
    new year,month,day;
    getdate(year, month, day);
    new strdate[20];
    format(strdate, sizeof(strdate), "%d.%d.%d",day,month,year);
    new file[256];
    format(file,sizeof(file),"/LuxAdmin/Accounts/%s.sav",udb_encode(PlayerName2(playerid)) );

    dUserSetINT(PlayerName2(playerid)).("Health",floatround(health));
    dUserSetINT(PlayerName2(playerid)).("Armour",floatround(armour));
    dini_Set(file,"LastOn",strdate);
    dUserSetINT(PlayerName2(playerid)).("Loggedin",0);
    dUserSetINT(PlayerName2(playerid)).("TimesOnServer",(dUserINT(PlayerName2(playerid)).("TimesOnServer"))+1);
}

The command should be:
pawn Code:
dcmd_savestats(playerid, params[])
{
    #pragma unused params
    SavePlayerStats(playerid);
    SendClientMessage(playerid, -1, "Your statistics have been saved!");
    return 1;
}
Roach_ is offline  
Old 31/01/2013, 07:57 PM   #3220
Hade.
Huge Clucker
 
Hade.'s Avatar
 
Join Date: Oct 2012
Location: Tallinn, Estonia
Posts: 210
Reputation: 16
Default Re: Script Request Thread #5

Quote:
Originally Posted by Hade. View Post
I need a derby system, heres my command below. I need that the limit is 4 people, i have 4 cars. And the last one in the derby, who has smashed all cars gets 10'000$, really need it.


Code:
CMD:derby(playerid, params[])
{
    new str7[128], player8[MAX_PLAYER_NAME];
    GetPlayerName(playerid, player8, sizeof(player8));
    format(str7,sizeof(str7),"%s teleportis end derbysse [/derby]",player8);
    SendClientMessageToAll(COLOR_GREEN,str7);
    new rand = random(sizeof(D1Rand));
    SetPlayerPos(playerid, D1Rand[rand][0], D1Rand[rand][1], D1Rand[rand][2]);
    SendClientMessage(playerid, COLOR_NGREEN,"Teleportisid end derbysse!");
    ResetPlayerWeapons(playerid);
    nocmd[playerid] = 1;
    return 1;
}
Someone help me with this?
__________________
Hade. is offline  
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Script Request Thread #3 clean180ollie Help Archive 836 05/01/2010 05:08 PM
Script Request Thread #2 Dol Help Archive 807 28/07/2009 10:09 AM
Script Request Thread kaisersouse Help Archive 1112 20/03/2009 12:15 PM


All times are GMT. The time now is 05:08 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.