New Idea - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: New Idea (
/showthread.php?tid=278589)
New Idea -
xbox360boy66 - 22.08.2011
Today i had an idea as i was going rambo on everyone on my server. And i thought of a new level sceme. Every one starts at Rank 0 and then when u kill some one who is rank 1 you become rank 1 and the person u killed is rank 0. but if you killed a rank 6 and you were 0, you would become 1 and the person you killed - 5. so you gain a rank for killing and drop a rank for being killed. The rank would be shown as score (Alt > name > ID > SCORE > ping) and the person who is like rank 10+ gets to have a weapon (shotgun) and rank 0s have pistols. Could some one just reply saying if it would be possible and if they know how could they..?
Re: New Idea -
Steven82 - 22.08.2011
This can be easily done. Look at a few rank system filterscripts and play around with it
Re: New Idea -
Kush - 22.08.2011
PHP Code:
new gVar_Rank[MAX_PLAYERS]; //an array defined as a variable
public OnPlayerDeath(playerid, killerid, reason) // on player death function with set parameters (player, the killer, the reason)
{
gVar_Rank[killerid]++; // will add 1 value when the killer kills a person
gVar_Rank[playerid]--; // will remove 1 value to the player in which dies
if(gVar_Rank[killerid] < 10) { GivePlayerWeapon(killerid, 22, 50 } // if the killer's rank is less than 10 they will get a pistol
else if (gVar_Rank[killerid] == 10 { GivePlayerWeapon(killerid, 25, 50 } // if rank value 10 they will get a shotgun
else if (gVar_Rank[killerid] == 20 { GivePlayerWeapon(killerid, 25, 50 } // if 20 they will get deagle
return 1; //returning the compound code as true.
}
Re: New Idea -
xbox360boy66 - 22.08.2011
Quote:
Originally Posted by Kush
PHP Code:
new gVar_Rank[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
gVar_Rank[killerid]++;
gVar_Rank[playerid]--;
if(gVar_Rank[killerid] < 10) { GivePlayerWeapon(killerid, 22, 50 }
else if (gVar_Rank[killerid] == 10 { GivePlayerWeapon(killerid, 25, 50 }
else if (gVar_Rank[killerid] == 20 { GivePlayerWeapon(killerid, 25, 50 }
return 1;
}
|
What does that do. could you possible explain it to me..? Im sucha noob at this. im just gonna pop it in pawno and compile and GOO... :P
Re: New Idea -
iPLEOMAX - 23.08.2011
Read everything with it's meaning.
pawn Code:
new gVar_Rank[MAX_PLAYERS]; //This is the variable where all the player's rank is stored.
public OnPlayerDeath(playerid, killerid, reason) //What all things happen when a player dies?
{
gVar_Rank[killerid]++; //The Rank of killer goes up++
gVar_Rank[playerid]--; //The Rank of the person died gets low--
if(gVar_Rank[killerid] < 10) { GivePlayerWeapon(killerid, 22, 50 } //if killer's rank is less than 10, give him a weapon with id 22 and 50 ammo.
else if (gVar_Rank[killerid] == 10) { GivePlayerWeapon(killerid, 25, 50 } //if killer's rank is '10', it gives him a weapon with id 25 and 50 ammo.
else if (gVar_Rank[killerid] == 20) { GivePlayerWeapon(killerid, 25, 50 } //if killer's rank is '20', it gives him a weapon with id 25 and 50 ammo again.
return 1;
}
Re: New Idea -
xbox360boy66 - 23.08.2011
Quote:
Originally Posted by iPLEOMAX
Read everything with it's meaning.
pawn Code:
new gVar_Rank[MAX_PLAYERS]; //This is the variable where all the player's rank is stored.
public OnPlayerDeath(playerid, killerid, reason) //What all things happen when a player dies? { gVar_Rank[killerid]++; //The Rank of killer goes up++ gVar_Rank[playerid]--; //The Rank of the person died gets low-- if(gVar_Rank[killerid] < 10) { GivePlayerWeapon(killerid, 22, 50 } //if killer's rank is less than 10. else if (gVar_Rank[killerid] == 10) { GivePlayerWeapon(killerid, 25, 50 } //if killer's rank is '10', it gives him a weapon with id 25 and 50 ammo. else if (gVar_Rank[killerid] == 20) { GivePlayerWeapon(killerid, 25, 50 } //if killer's rank is '20', it gives him a weapon with id 25 and 50 ammo again. return 1; }
|
Cheers man
Re: New Idea -
Kush - 23.08.2011
Quote:
Originally Posted by iPLEOMAX
Read everything with it's meaning.
pawn Code:
new gVar_Rank[MAX_PLAYERS]; //This is the variable where all the player's rank is stored.
public OnPlayerDeath(playerid, killerid, reason) //What all things happen when a player dies? { gVar_Rank[killerid]++; //The Rank of killer goes up++ gVar_Rank[playerid]--; //The Rank of the person died gets low-- if(gVar_Rank[killerid] < 10) { GivePlayerWeapon(killerid, 22, 50 } //if killer's rank is less than 10, give him a weapon with id 22 and 50 ammo. else if (gVar_Rank[killerid] == 10) { GivePlayerWeapon(killerid, 25, 50 } //if killer's rank is '10', it gives him a weapon with id 25 and 50 ammo. else if (gVar_Rank[killerid] == 20) { GivePlayerWeapon(killerid, 25, 50 } //if killer's rank is '20', it gives him a weapon with id 25 and 50 ammo again. return 1; }
|
iPLEOMAX, you've posted right after i explained -_-
:P
Re: New Idea -
xbox360boy66 - 23.08.2011
G:\Games\Rockstar Games\GTA San Andreas (normal)\gta samp server\gamemodes\Kill rank system.pwn(6) : fatal error 100: cannot read from file: "gvar"
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Re: New Idea -
iPLEOMAX - 23.08.2011
Show us how you pasted it. (Post the whole .pwn file)
@Kush
Re: New Idea -
xbox360boy66 - 23.08.2011
ite dont laugh plz im realy shit at this stuff xD
Code:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <gvar>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
new gVar_Rank[MAX_PLAYERS]; //This is the variable where all the player's rank is stored.
public OnPlayerDeath(playerid, killerid, reason) //What all things happen when a player dies?
{
gVar_Rank[killerid]++; //The Rank of killer goes up++
gVar_Rank[playerid]--; //The Rank of the person died gets low--
if(gVar_Rank[killerid] < 10) { GivePlayerWeapon(killerid, 22, 50 } //if killer's rank is less than 10, give him a weapon with id 22 and 50 ammo.
else if (gVar_Rank[killerid] == 10) { GivePlayerWeapon(killerid, 25, 50 } //if killer's rank is '10', it gives him a weapon with id 25 and 50 ammo.
else if (gVar_Rank[killerid] == 20) { GivePlayerWeapon(killerid, 25, 50 } //if killer's rank is '20', it gives him a weapon with id 25 and 50 ammo again.
return 1;
}