[GameMode] Si Freeroam 2.0 (Full Version)
#4

Quote:
Originally Posted by Dice_
View Post
No need to create a new thread. Just edit or make a new post in your old topic.
MySQL or SQLite version would be better instead
I'm not good with MySQL or SQLite. I don't want to ruin the script. If you have any knowledge about MySQL or SQLite you can do it yourself & re-publish it under your name.


Quote:
Originally Posted by SiaReyes
View Post
Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo[playerid][pDeaths]++;

    if(GetPlayerMoney(playerid) < 500)
    {
      SendClientMessage(playerid, CRED, "[SERVER]: You didn't have $500 to fix your wounds, the server paid in your place!");
    }
    else if(GetPlayerMoney(playerid) > 500)
    {
      SendClientMessage(playerid, CRED, "[SERVER]: You got killed/self-death and paid $500 to fix your wounds.");
      GivePlayerMoney(playerid, -500);
      PlayerInfo[playerid][pCash] -= 500;
    }

    if(killerid != INVALID_PLAYER_ID)
    {
        PlayerInfo[killerid][pKills]++;
        new pname[MAX_PLAYER_NAME], ename[MAX_PLAYER_NAME], string[128];
        GetPlayerName(playerid, pname, sizeof(pname));
        GetPlayerName(killerid, ename, sizeof(ename));
        format(string, sizeof(string), "[SERVER]: You killed %s and looted $1,000 from him (+ 1 Score).", pname);
        SendClientMessage(killerid, CLIME, string);
        format(string, sizeof(string), "[SERVER]: You have been killed by %s!", ename);
        SendClientMessage(playerid, CRED, string);
        GivePlayerMoney(killerid, 1000);
        PlayerInfo[killerid][pCash] += 1000;
        SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
    }

    SendDeathMessage(killerid, playerid, reason);

    return 1;
}
I think, it should be like, you didn't check if killerid is a valid player, it will throw runtime error.
You have declared pCash but didn't use it and also mySQL or SQLite Version will be good for a freeroam gamemode.
Thanks for your feedback. I've added the script you gave me (OnPlayerDeath) and about MySQL & SQLite i'm not good at using theml.
Reply


Messages In This Thread
Si Freeroam 2.0 (Full Version) - by SiM2hmoud - 29.03.2020, 11:14
Re: Si Freeroam 2.0 (Full Version) - by Fairuz - 29.03.2020, 11:27
Re: Si Freeroam 2.0 (Full Version) - by SiaReyes - 29.03.2020, 11:29
Re: Si Freeroam 2.0 (Full Version) - by SiM2hmoud - 29.03.2020, 12:10

Forum Jump:


Users browsing this thread: 1 Guest(s)