17.01.2019, 13:27
Here i fixed it for you
Next time, if you want to try to migrate from old mysql to new mysql, read the wiki first.
https://sampwiki.blast.hk/wiki/MySQL/R40
PHP код:
forward public OnPlayerLogin(playerid);
public OnPlayerLogin(playerid)
{
new found = 0;
new pName[24], str[256];
SetPVarInt(playerid, "Admin", cache_get_value_int(0, "Admin"));
SetPVarInt(playerid, "PassedRPTest", cache_get_value_int(0, "PassedRPTest"));
SetPVarInt(playerid, "CharacterMade", cache_get_value_int(0, "CharacterMade"));
SetPVarInt(playerid, "AppMade", cache_get_value_int(0, "AppMade"));
PlayerInfo[playerid][LoggedIn] = true;
new fetch[256];
cache_get_field_name(0, "AdminName", fetch);
format(PlayerInfo[playerid][AdminName], 256, fetch);
for(new i = 1; i < MAX_APPLICATIONS; i++)
{
if(ApplicationInfo[i][SentIn] == 1)
{
found++;
}
}
if(GetPVarInt(playerid, "Admin") >= 1 || IsPlayerAdmin(playerid))
{
if(found > 0)
{
format(str, sizeof(str), "Server: There are currently (%d) applications waiting approval. (/applications)", found);
SendClientMessage(playerid, COLOR_ORANGE, str);
}
}
if(GetPVarInt(playerid, "CharacterMade") == 0)
{
if(GetPVarInt(playerid, "PassedRPTest") == 0)
{
if(GetPVarInt(playerid, "AppMade") == 1) {
SendClientMessage(playerid, COLOR_ORANGE, "Server: It looks like you have already done an application to join our server.");
SendClientMessage(playerid, COLOR_ORANGE, "We are sorry it's taking so long for you to be reviewed, Please have patients, Thanks.");
SendClientMessage(playerid, COLOR_ORANGE, "Would you like to take a multi-choice test?");
ShowPlayerDialog(playerid, TakeMultiChoice, DIALOG_STYLE_MSGBOX, "Take a different test?", "Would you like to take the multiple choice test?", "Yes", "No");
PlayerInfo[playerid][AppID] = cache_get_value_int(0, "AppID");
ApplicationInfo[PlayerInfo[playerid][AppID]][PlayerID] = playerid;
}
if(GetPVarInt(playerid, "AppMade") == 0) {
AdminsOnline(playerid);
SetPVarInt(playerid, "Questions", 1);
}
SetSpawnInfo(playerid, 0, 305, 1494.8589, 1306.48, 1093.2953, 269.15, 0, 0, 0, 0, 0, 0 );
SetPlayerInterior(playerid,3);
SetPlayerVirtualWorld(playerid, playerid+1);
SpawnPlayer(playerid);
SetPlayerSkin(playerid, 305);
TogglePlayerSpectating(playerid, 0);
TextDrawShowForPlayer(playerid,MoneyDraw[playerid]);
return 1;
}
else {
SendClientMessage(playerid, COLOR_ORANGE, "Server: Logged in, please make your character.");
SetSpawnInfo(playerid, 0, 305, 1494.8589, 1306.48, 1093.2953, 269.15, 0, 0, 0, 0, 0, 0 );
SetPlayerInterior(playerid,3);
SetPlayerVirtualWorld(playerid, playerid+1);
SpawnPlayer(playerid);
SetPlayerSkin(playerid, 305);
ShowCreateCharacterMenu(playerid);
TogglePlayerSpectating(playerid, 0);
TextDrawShowForPlayer(playerid,MoneyDraw[playerid]);
return 1;
}
}
SetPVarInt(playerid, "Skin", cache_get_value_int(0, "Skin"));
SetPVarInt(playerid, "Sex", cache_get_value_int(0, "Sex"));
SetPVarInt(playerid, "Age", cache_get_value_int(0, "Age"));
SetPVarInt(playerid, "Cash", cache_get_value_int(0, "Cash"));
SetPVarInt(playerid, "Bank", cache_get_value_int(0, "Bank"));
SetPVarInt(playerid, "Interior", cache_get_value_int(0, "Interior"));
SetPVarInt(playerid, "VirtualWorld", cache_get_value_int(0, "VirtualWorld"));
SetPVarFloat(playerid, "PosX", cache_get_value_float(0, "PosX"));
SetPVarFloat(playerid, "PosY", cache_get_value_float(0, "PosY"));
SetPVarFloat(playerid, "PosZ", cache_get_value_float(0, "PosZ"));
SetPVarFloat(playerid, "PosA", cache_get_value_float(0, "PosA"));
GetPlayerName(playerid, pName, 24);
GiveNameSpace(pName);
format(str, sizeof(str), "Server: Welcome back %s, Thank you for being part of the community.", pName);
SendClientMessage(playerid, COLOR_ORANGE, str);
SetSpawnInfo(playerid, 0, GetPVarInt(playerid, "Skin"), GetPVarFloat(playerid, "PosX"), GetPVarFloat(playerid, "PosY"), GetPVarFloat(playerid, "PosZ"), GetPVarFloat(playerid, "PosA"), 0, 0, 0, 0, 0, 0 );
SetPlayerInterior(playerid, GetPVarInt(playerid, "Interior"));
SetPlayerVirtualWorld(playerid, GetPVarInt(playerid, "VirtualWorld"));
SpawnPlayer(playerid);
SetCameraBehindPlayer(playerid);
SetPlayerSkin(playerid, GetPVarInt(playerid, "Skin"));
PlayerInfo[playerid][AppID] = -1;
TogglePlayerSpectating(playerid, 0);
TextDrawShowForPlayer(playerid,MoneyDraw[playerid]);
SetPlayerMoneyEx(playerid, GetPVarInt(playerid, "Cash"));
return 1;
}
https://sampwiki.blast.hk/wiki/MySQL/R40

