0
@foxon prieš 8 metus
Kodėl neužkrauna?
duomenų baze viskas ok, bet žaidime neužkrauna....
Kodas:
public OnPlayerConnect(playerid)
{
//////registracija
GetPlayerName(playerid,pInfo[playerid][Vardas],24);
pInfo[playerid][ORM_ID] = orm_create("vartotojai",DbHandle);
orm_addvar_int(pInfo[playerid][ORM_ID],pInfo[playerid][ID],"ID");
orm_addvar_string(pInfo[playerid][ORM_ID],pInfo[playerid][Vardas],24,"Vardas");
orm_addvar_string(pInfo[playerid][ORM_ID],pInfo[playerid][Slaptazodis],129,"Slaptazodis");
orm_addvar_int(pInfo[playerid][ORM_ID],pInfo[playerid][Pinigai],"Pinigai");
orm_addvar_int(pInfo[playerid][ORM_ID],pInfo[playerid][XP],"XP");
orm_addvar_float(pInfo[playerid][ORM_ID],pInfo[playerid][HP],"HP");
orm_addvar_float(pInfo[playerid][ORM_ID],pInfo[playerid][Health],"health");
orm_addvar_float(pInfo[playerid][ORM_ID],pInfo[playerid][SpawnX],"SpawnX");
orm_addvar_float(pInfo[playerid][ORM_ID],pInfo[playerid][SpawnY],"SpawnY");
orm_addvar_float(pInfo[playerid][ORM_ID],pInfo[playerid][SpawnZ],"SpawnZ");
orm_setkey(pInfo[playerid][ORM_ID],"Vardas");
orm_select(pInfo[playerid][ORM_ID],"OnPlayerCheck","d",playerid);
orm_select(pInfo[playerid][ORM_ID],"OnPlayerDataLoad","i",playerid);
return 1;
}
forward OnPlayerCheck(playerid);
public OnPlayerCheck(playerid)
{
switch(orm_errno(pInfo[playerid][ORM_ID]))
{
case ERROR_OK: ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Prisijungimas","Įveskite savo slaptažodį žemiau","Prisijungti","Išeiti");
case ERROR_NO_DATA: ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"Registracija","Įvesktie savo slaptažodį žemiau","Registruotis","Išeiti");
}
orm_setkey(pInfo[playerid][ORM_ID],"ID");
//serverio prisijungimo/registracijos textas
for(new i = 0; i < 10; i++) SendClientMessageToAll(woring," ");
SendClientMessage(playerid, balta, "Sveikas atvykęs į {B04245}samp{FFFFFF} serverį!");
SendClientMessage(playerid, balta, "buk sveikas.....!");
return 1;
}
forward OnPlayerDataLoad(playerid);
public OnPlayerDataLoad(playerid)
{
switch(orm_errno(pInfo[ playerid ][ORM_ID]))
{
case ERROR_NO_DATA:
{
}
case ERROR_OK:
{
}
}
orm_setkey(pInfo[playerid][ORM_ID], "id");
}
0
@foxon prieš 8 metus
Kažkas neveikia...
Pas mane mysql R34
Eilute:
forward OnPlayerDataLoad(playerid);
public OnPlayerDataLoad(playerid)
{
switch(orm_errno(pInfo[playerid][ORM_ID]))
{
case ERROR_NO_DATA:
{
}
case ERROR_OK:
{
}
orm_setkey(pInfo[playerid][ORM_ID], "id");
}
}
Klaida:
C:\*********************************.pwn(107) : error 002: only a single statement (or expression) can follow each "case"
C:\*********************************.pwn(107) : warning 215: expression has no effect
C:\*********************************.pwn(109) : error 054: unmatched closing brace ("}")