Ajutor!!
#1

Am o comanda /getjobc si vreau sa ii schimbe din job 0 in job 1.
Am incercat cu pInfo[playerid][pJob]=1;
dar nu se schimba in folderul user/job=0

PHP код:
CMD:getjobc(playerid)
{
    if(
IsPlayerInRangeOfPoint(playerid,4,589.7928,870.6724,-42.4973))
    {
    
SendClientMessage(playerid,-1,"{FF0000}INFO:{FFFFFF}Acuma esti muncitor la cariera");
    
PlayerInfo[playerid][pJob] = 1;
    }
    else 
SendClientMessage(playerid, -1"{FF0000}INFO:{FFFFFF}Nu esti in locul potrivit,ti-am setat un checkpoint catre job.");
    
SetPlayerCheckpoint(playerid,589.7928,870.6724,-42.4973,3.0);
    
onjobc[playerid] = true;
    return 
1;

Reply
#2

Arata-ne functia care salveaza datele jucatorilor... "SavePlayerData" sau ceva asemanator.
Reply
#3

PHP код:
enum pInfo
{
    
pPass,
    
pCash,
    
pAdmin,
    
pSkin,
    
pScore,
    
pJob
}
new 
PlayerInfo[MAX_PLAYERS][pInfo];
//===================== P I C K U P ============================//
new pickup;
//===================== F O R W A R D ==========================//
forward LoadUser_data(playerid,name[],value[]);
public 
LoadUser_data(playerid,name[],value[])
{
    
INI_Int("Password",PlayerInfo[playerid][pPass]);
    
INI_Int("Cash",PlayerInfo[playerid][pCash]);
    
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    
INI_Int("Score",PlayerInfo[playerid][pScore]);
    
INI_Int("Skin",PlayerInfo[playerid][pSkin]);
    
INI_Int("Job",PlayerInfo[playerid][pJob]);
    return 
1;

Quote:
Originally Posted by Lumineux
Посмотреть сообщение
Arata-ne functia care salveaza datele jucatorilor... "SavePlayerData" sau ceva asemanator.
Reply
#4

Quote:
Originally Posted by Calinut200
Посмотреть сообщение
Am o comanda /getjobc si vreau sa ii schimbe din job 0 in job 1.
Am incercat cu pInfo[playerid][pJob]=1;
dar nu se schimba in folderul user/job=0

PHP код:
CMD:getjobc(playerid)
{
    if(
IsPlayerInRangeOfPoint(playerid,4,589.7928,870.6724,-42.4973))
    {
    
SendClientMessage(playerid,-1,"{FF0000}INFO:{FFFFFF}Acuma esti muncitor la cariera");
    
PlayerInfo[playerid][pJob] = 1;
    }
    else 
SendClientMessage(playerid, -1"{FF0000}INFO:{FFFFFF}Nu esti in locul potrivit,ti-am setat un checkpoint catre job.");
    
SetPlayerCheckpoint(playerid,589.7928,870.6724,-42.4973,3.0);
    
onjobc[playerid] = true;
    return 
1;

CMD:getjobc(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,4,589.7928,870. 6724,-42.4973))
{
SendClientMessage(playerid,-1,"{FF0000}INFO:{FFFFFF}Acuma esti muncitor la cariera");
PlayerInfo[playerid][pJob] = 1;
}
else SendClientMessage(playerid, -1, "{FF0000}INFO:{FFFFFF}Nu esti in locul potrivit,ti-am setat un checkpoint catre job.");
SetPlayerCheckpoint(playerid,589.7928,870.6724,-42.4973,3.0);
onjobc[playerid] = true;
new INI:PlayerFile = INI_Open(aici puneti adresa catre fisier al acestui player);
INI_WriteInt(PlayerFile,"Job",PlayerInfo[playerid][pJob]);
INI_Close(PlayerFile);
return 1;
}
Reply
#5

Am scris asa
new INI:PlayerFile = INI_Open"LoadUser_%s";
INI_WriteInt(PlayerFile,"Job",PlayerInfo[playerid][pJob]);
INI_Close(PlayerFile);
dar da niste erori


C:\Users\Calinut200\Desktop\MY serever\gamemodes\RPG.pwn(205) : error 076: syntax error in the expression, or invalid function call
Reply
#6

Quote:
Originally Posted by Calinut200
Посмотреть сообщение
Ceva de genu?new INI:PlayerFile = INI_Open"LoadUser_%s"; sau in paranteze?
pai uitativa unde se salveaza toti playerii
de exemplu:



new string[128],playerName[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
format(string,sizeof(string),"scriptfiles/ladmin/users/%s.sav",playerName);
new INI:PlayerFile = INI_Open(string);
Reply
#7

Quote:
Originally Posted by Calinut200
Посмотреть сообщение
Am scris asa
new INI:PlayerFile = INI_Open"LoadUser_%s";
INI_WriteInt(PlayerFile,"Job",PlayerInfo[playerid][pJob]);
INI_Close(PlayerFile);
dar da niste erori


C:\Users\Calinut200\Desktop\MY serever\gamemodes\RPG.pwn(205) : error 076: syntax error in the expression, or invalid function call
ma asa ceva nu exista! INI_Open"LoadUser_%s";
Reply
#8

Quote:
Originally Posted by shiftlol
Посмотреть сообщение
ma asa ceva nu exista! INI_Open"LoadUser_%s";

am facut dupa exemplu asta e codu
PHP код:
CMD:getjobc(playerid)
{
    if(
IsPlayerInRangeOfPoint(playerid,4,589.7928,870.6724,-42.4973))
    {
    new 
string[128],playerName[MAX_PLAYER_NAME+1];
    
GetPlayerName(playeridplayerNameMAX_PLAYER_NAME);
    
format(string,sizeof(string),"scriptfiles/Users/%s.ini",playerName);
    new 
INI:PlayerFile INI_Open(string);
    
INI_WriteInt(PlayerFile,"Job",PlayerInfo[playerid][pJob]);
    
INI_Close(PlayerFile);
    
PlayerInfo[playerid][pJob] = 1;
    
SendClientMessage(playerid,-1,"{FF0000}INFO:{FFFFFF}Acuma esti muncitor la cariera");
    }
    else 
SendClientMessage(playerid, -1"{FF0000}INFO:{FFFFFF}Nu esti in locul potrivit,ti-am setat un checkpoint catre job.");
    
SetPlayerCheckpoint(playerid,589.7928,870.6724,-42.4973,3.0);
    
onjobc[playerid] = true;
    return 
1;

dar nu merge
Reply
#9

Quote:
Originally Posted by Calinut200
Посмотреть сообщение
am facut dupa exemplu asta e codu
PHP код:
CMD:getjobc(playerid)
{
    if(
IsPlayerInRangeOfPoint(playerid,4,589.7928,870.6724,-42.4973))
    {
    new 
string[128],playerName[MAX_PLAYER_NAME+1];
    
GetPlayerName(playeridplayerNameMAX_PLAYER_NAME);
    
format(string,sizeof(string),"scriptfiles/Users/%s.ini",playerName);
    new 
INI:PlayerFile INI_Open(string);
    
INI_WriteInt(PlayerFile,"Job",PlayerInfo[playerid][pJob]);
    
INI_Close(PlayerFile);
    
PlayerInfo[playerid][pJob] = 1;
    
SendClientMessage(playerid,-1,"{FF0000}INFO:{FFFFFF}Acuma esti muncitor la cariera");
    }
    else 
SendClientMessage(playerid, -1"{FF0000}INFO:{FFFFFF}Nu esti in locul potrivit,ti-am setat un checkpoint catre job.");
    
SetPlayerCheckpoint(playerid,589.7928,870.6724,-42.4973,3.0);
    
onjobc[playerid] = true;
    return 
1;

dar nu merge
da mie modul eu voi scrie!
Reply
#10

Quote:
Originally Posted by shiftlol
Посмотреть сообщение
da mie modul eu voi scrie!
CE mod?Gamemode-ul?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)