Little help
#1

hellow guys i need to make a system

like when the player connects and he has 0 score and he goes to chose the team FBI i want it if he doent have 50 score he cant be a FBI and if he has it he can choose FBI
Reply
#2

can u show me your OnPlayerRequestClass ?
Reply
#3

Hey, little hard to just write out without your script... whats your skype, i can do it though there?
Reply
#4

What INI Reader/Writer you are using?

You will need to load the file of the user before he gets to choosing the team.
Reply
#5

Ha nevermind AVI can help you
Reply
#6

Thanks for the intrest

pawn Код:
public OnPlayerRequestClass( playerid, classid )
{
SetPlayerCameraPos(playerid, 2220.9197,-1164.0920,25.7331);
SetPlayerCameraLookAt(playerid, 2215.1963,-1164.0492,25.7266);
SetPlayerPos(playerid, 2215.1963,-1164.0492,25.7266);
SetPlayerFacingAngle(playerid, 270.5322);
ApplyAnimation(playerid,"DANCING","DAN_LOOP_A",4.0,1,0,0,0,-1);
SetPlayerTeamFromClass(playerid, classid);
return 1;
}
// Teams
SetPlayerTeamFromClass(playerid, classid)
{
switch (classid) {
case 0 ..2: {
gTeam[playerid] = TEAM_AZTECAS;
GameTextForPlayer(playerid,"~w~[]AZTECAS][",2000,5);
}
case 3 ..5: {
gTeam[playerid] = TEAM_VAGO;
GameTextForPlayer(playerid,"~y~[]Vagos[]",2000,5);
}
case 6 ..11: {
gTeam[playerid] = TEAM_GROVE;
GameTextForPlayer(playerid,"~g~[]Grove[]",2000,5);
}
case 12 .. 14: {
gTeam[playerid] = TEAM_BALLA;
GameTextForPlayer(playerid,"~p~[]Balla[]",2000,5);
}
case 15 ..16: {
gTeam[playerid] = TEAM_BIKER;
GameTextForPlayer(playerid,"~l~[]BIKER[]",2000,5);
}
case 17 ..19: {
gTeam[playerid] = TEAM_MEDIC;
GameTextForPlayer(playerid,"~w~[]Medic[]",2000,5);
}
case 20 ..22: {
gTeam[playerid] = TEAM_WHORE;
GameTextForPlayer(playerid,"~r~[]Whore[]",2000,5);
}
case 23 ..25: {
gTeam[playerid] = TEAM_COP;
GameTextForPlayer(playerid,"~b~[]Cops[]",2000,5);
}
case 26 ..27: {
gTeam[playerid] = TEAM_INDIAN;
GameTextForPlayer(playerid,"~w~[]Indian[]",2000,5);
}
}
return 1;
}
Reply
#7

Why dont you load the user file? Is there any callback as LoadUser? Show it to us over here.
Reply
#8

i use this for the saving

pawn Код:
#define FILTERSCRIPT

#include <a_samp>
#include <Dini>
#include <Dutils>
#include <Dudb>

#define savefolder "/save/%s.ini"

#pragma unused ret_memcpy

new Killz[MAX_PLAYERS];
new Deathz[MAX_PLAYERS];



public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}


public OnPlayerRequestClass(playerid, classid)
{
return 1;
}

public OnPlayerConnect(playerid)
{
new pname[128];
new file[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), savefolder,pname);
if(!dini_Exists(file)) {
dini_Create(file);
dini_IntSet(file, "Score", 0);
dini_IntSet(file, "Kills", Killz[playerid]);
dini_IntSet(file, "Deaths", Deathz[playerid]);
SetPlayerScore(playerid, dini_Int(file, "Score"));

}
else {
SetPlayerScore(playerid, dini_Int(file, "Score"));
       
}
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
new pname[128];
new file[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), savefolder,pname);
if(!dini_Exists(file)) {
}
else {
dini_IntSet(file, "Score", GetPlayerScore(playerid));
dini_IntSet(file, "Kills", Killz[playerid]);
dini_IntSet(file, "Deaths", Deathz[playerid]);
}
return 1;
}



public OnPlayerDeath(playerid, killerid, reason)
{
Killz[killerid] ++;
Deathz[playerid] ++;
return 1;
}
its a TDM server skin does not save
Reply
#9

You have to check if the player has 50 score, otherwise he won't be able to join.
Reply
#10

he wont be able to join the FBI team
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)