Easy pawno ideas
#1

I'm learning pawno myself, but I don't have any ideas on what do I script? A guy recommended fastfood stand to script, it went well. I don't know what to script else? Any suggestions? Don't make it hard I'm not making my own server.
Reply
#2

Make just some house system.. it aint hard.
Reply
#3

Start making simple things such as a intermediate god-mode system. Then as you get better you can make full scripts with loading/saving systems such as an admin/user system.
Reply
#4

How do I make godmode, I don't even know? Like this:

Код:
CMD:godmode(playerid, params[])
{
	 SendClientMessage(playerid, 0x99FFFF, "You're in godmode now. You may not die");
	 AddPlayerHealth(playerid, 20000000000);
	 new playerState = GetPlayerState(playerid);
	 if(playerState == PLAYER_STATE_DRIVER)
	 {
	 SendClientMessage(playerid, 0xAA3333AA, "You can't have God-Mode in a vehicle!");
	 }
     return 1;
}
Made it all by myself didn't look anything up on the internet! Not sure if it will work.
Reply
#5

Quote:
Originally Posted by Bek_Loking
Посмотреть сообщение
How do I make godmode, I don't even know? Like this:

Код:
CMD:godmode(playerid, params[])
{
	 SendClientMessage(playerid, 0x99FFFF, "You're in godmode now. You may not die");
	 AddPlayerHealth(playerid, 20000000000);
	 new playerState = GetPlayerState(playerid);
	 if(playerState == PLAYER_STATE_DRIVER)
	 {
	 SendClientMessage(playerid, 0xAA3333AA, "You can't have God-Mode in a vehicle!");
	 }
     return 1;
}
Made it all by myself didn't look anything up on the internet! Not sure if it will work.
You are on the right path, you just need to use a timer for the health setting (Else the player will get a really high health but if 10 players with miniguns are shooting him he will still die pretty quickly).
I would do it like this;
pawn Код:
enum playerinfo
{
    GodMode,
    Float:NormalHealth
}
new PlayerInfo[MAX_PLAYERS][playerinfo];

forward GlobalTimer();

public GlobalTimer()
{
    // Would be better to use foreach but I don't know if you know/use it so I'll just use a for loop.
    for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) if(PlayerInfo[i][GodMode] == 1)  if(GetHealth(i) != 99999999) SetPlayerHealth(i, 99999999);
    return 1;
}

public OnGameModeInit()
{
    SetTimer("GlobalTimer", 1000, true);
    return 1;
}

stock GetHealth(playerid)
{
    new Float:Health;
    GetPlayerHealth(playerid, Health);
    return Health;
}

CMD:godmode(playerid, params[])
{
    if(PlayerInfo[playerid][GodMode] != 1)
        {
        if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, ">  You can't use godmode while in a vehicle!");
        PlayerInfo[playerid][NormalHealth] = GetHealth(playerid);
        PlayerInfo[playerid][GodMode] = 1;
        SendClientMessage(playerid, 0xFFFFFFFF, ">  Godmode is now enabled!");
        }
    else
        {
        PlayerInfo[playerid][GodMode] = 0;
        SetPlayerHealth(playerid, PlayerInfo[playerid][NormalHealth]);
        SendClientMessage(playerid, 0xFFFFFFFF, ">  Godmode is now disabled!");
        }
    return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(PlayerInfo[playerid][GodMode] == 1)
        {
        PlayerInfo[playerid][GodMode] = 0;
        SetPlayerHealth(playerid, PlayerInfo[playerid][NormalHealth]);
        SendClientMessage(playerid, 0xFFFFFFFF, ">  Godmode is now disabled!");
        }
    return 1;
}
If there are any questions about the code feel free to ask!

Best regards,
Jesse
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)