[Tutorial] Making A Class System(Very Simple+Easy+Dialogs+Texts)
#21

thnx
Reply
#22

topic updated
think so its well explaned now
Reply
#23

Well To be honest you need to explain abit more and you shouldn't ask for rep people would give you it if you deserve it
Reply
#24

Decent tutorial, good job
Reply
#25

I have one error
******.pwn(429) : warning 217: loose indentation
pawn Code:
if(dialogid == 999)
            {
                if(response)
                    {
                if(listitem == 0)
                    {
                    if(GetPlayerScore(playerid) >= 0)
                        {
                        SendClientMessage(playerid, COLOR_WHITE, "You chose the Zombie as your class.");
                        ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Zombie Class:", "{F81414}Abilities:\n{FFFFFF}A Solo class, good in infantry attacks.\n\n{F81414}Weapons:\n\n{FFFFFF}Knife\n{FFFFFF}Chainsaw", "Play","");
                        gPlayerClass[playerid] = Zombie;
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        ResetPlayerWeapons(playerid);
                        GivePlayerWeapon(playerid, 4, 1);
                        GivePlayerWeapon(playerid, 9, 1);
                        }
                    }

                if(listitem == 1)
                    {
                    if(GetPlayerScore(playerid) >= 1)
                        {
                            SendClientMessage(playerid, COLOR_WHITE, "You chose the Sniper as your class.");
                            ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Sniper Class:", "{F81414}Abilities:\n{FFFFFF}A Locater class, Always invisible on map.\n\n{F81414}Weapons:\n\n{FFFFFF}Sniper Rifle\n{FFFFFF}Mp5\n{FFFFFF}Knife", "Play","");
                            gPlayerClass[playerid] = Human;
                            PickedClass[playerid] = 1;
                            RemovePlayerMapIcon(playerid, 0);
                            SetPlayerVirtualWorld(playerid, 0);
                            TogglePlayerControllable(playerid, 1);
                            ResetPlayerWeapons(playerid);
                            GivePlayerWeapon(playerid, 12, 250);
                            GivePlayerWeapon(playerid, 29, 250);
                            GivePlayerWeapon(playerid, 4, 1);
                        }

                    }
                return 1;
        }

    return 1;//line 429
}
return true;
}
Ё
How i can fix this?
Reply
#26

Quote:
Originally Posted by Coder_
View Post
I have one error
******.pwn(429) : warning 217: loose indentation
pawn Code:
if(dialogid == 999)
            {
                if(response)
                    {
                if(listitem == 0)
                    {
                    if(GetPlayerScore(playerid) >= 0)
                        {
                        SendClientMessage(playerid, COLOR_WHITE, "You chose the Zombie as your class.");
                        ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Zombie Class:", "{F81414}Abilities:\n{FFFFFF}A Solo class, good in infantry attacks.\n\n{F81414}Weapons:\n\n{FFFFFF}Knife\n{FFFFFF}Chainsaw", "Play","");
                        gPlayerClass[playerid] = Zombie;
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        ResetPlayerWeapons(playerid);
                        GivePlayerWeapon(playerid, 4, 1);
                        GivePlayerWeapon(playerid, 9, 1);
                        }
                    }

                if(listitem == 1)
                    {
                    if(GetPlayerScore(playerid) >= 1)
                        {
                            SendClientMessage(playerid, COLOR_WHITE, "You chose the Sniper as your class.");
                            ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Sniper Class:", "{F81414}Abilities:\n{FFFFFF}A Locater class, Always invisible on map.\n\n{F81414}Weapons:\n\n{FFFFFF}Sniper Rifle\n{FFFFFF}Mp5\n{FFFFFF}Knife", "Play","");
                            gPlayerClass[playerid] = Human;
                            PickedClass[playerid] = 1;
                            RemovePlayerMapIcon(playerid, 0);
                            SetPlayerVirtualWorld(playerid, 0);
                            TogglePlayerControllable(playerid, 1);
                            ResetPlayerWeapons(playerid);
                            GivePlayerWeapon(playerid, 12, 250);
                            GivePlayerWeapon(playerid, 29, 250);
                            GivePlayerWeapon(playerid, 4, 1);
                        }

                    }
                return 1;
        }

    return 1;//line 429
}
return true;
}
Ё
How i can fix this?
sorry i cant help as i am accessing net on TV
i will help after 2/3 hours
Reply
#27

Quote:
Originally Posted by Jarnu
Посмотреть сообщение
Код:
!=
this means.. not equal to -__- not that
Код:
==
ohh i didnt noticed that
Reply
#28

Nice tutorial.
Reply
#29

Quote:
Originally Posted by [xB]Lordz
Посмотреть сообщение
Nice tutorial.

thnx lordz
Reply
#30

I need help
pawn Код:
C:\Users\Bichan\Desktop\UKTDM\gamemodes\UKTDM.pwn(96) : warning 217: loose indentation
C:\Users\Bichan\Desktop\UKTDM\gamemodes\UKTDM.pwn(437) : error 001: expected token: ";", but found "return"
C:\Users\Bichan\Desktop\UKTDM\gamemodes\UKTDM.pwn(448) : error 035: argument type mismatch (argument 2)
C:\Users\Bichan\Desktop\UKTDM\gamemodes\UKTDM.pwn(449) : error 001: expected token: ";", but found "return"
C:\Users\Bichan\Desktop\UKTDM\gamemodes\UKTDM.pwn(461) : error 001: expected token: ";", but found "return"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
That is when i add the CMDS in onplayercommandtext
Reply
#31

It Helps me, Ty
Reply
#32

Its wrongly made on the player command text, you forgot the ";" after SetPlayerColor, fix it..
Reply
#33

man you copyd these classes from COD5SAMP ! all commands are the same !
Reply
#34

i got these errors
Код:
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(200) : error 017: undefined symbol "stSpawn"
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(238) : warning 225: unreachable code
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(238) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(238) : error 004: function "OnPlayerConnect" is not implemented
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(247) : warning 225: unreachable code
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(247) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(247) : error 004: function "OnPlayerDisconnect" is not implemented
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(256) : warning 225: unreachable code
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(256) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(256) : error 004: function "OnPlayerSpawn" is not implemented
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(285) : error 017: undefined symbol "JETROOPER"
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(357) : warning 225: unreachable code
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(357) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(357) : error 004: function "OnPlayerDeath" is not implemented
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(359) : error 017: undefined symbol "killerid"
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(360) : error 017: undefined symbol "killerid"
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(363) : error 017: undefined symbol "killerid"
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(364) : error 017: undefined symbol "killerid"
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(370) : warning 225: unreachable code
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(370) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(370) : error 004: function "OnVehicleSpawn" is not implemented
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(375) : warning 225: unreachable code
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(375) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(375) : error 004: function "OnVehicleDeath" is not implemented
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(380) : warning 225: unreachable code
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(380) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(380) : error 004: function "OnPlayerText" is not implemented
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(385) : warning 225: unreachable code
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(385) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(385) : error 004: function "zcmd_OnPlayerCommandText" is not implemented
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(387) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(397) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(407) : warning 217: loose indentation
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(407) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\Owner\Desktop\karlis red vs blue\red vs bue\gamemodes\army.pwn(415) : error 001: expected token: ";", but found "return"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
Reply
#35

Hmm nice tutorial.
Reply
#36

Nice tutorial...
It helped me a lot
Reply
#37

hi bro this is awsome tutorial for class system n its work for me " +REP " but i have a problem i can fly hunter, hydra, sea sparrow n can drive rhino if i have selected solder class can u help me??

my code

Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new vehicleid = GetPlayerVehicleID(playerid);//variable to get vehicle ids
    if(GetVehicleModel(vehicleid) == 425 && gPlayerClass[playerid] == SOLDIER && gPlayerClass[playerid] == SNIPER && gPlayerClass[playerid] == ENGINEER && gPlayerClass[playerid] == JETMASTER && gPlayerClass[playerid] == SPY)//if player is pilot then he can drive
    {
        SendClientMessage(playerid, COLOR_RED, "You Need to  be a Pilot to fly Hunter");//messages goes to the player that he can't drive the hunter
        RemovePlayerFromVehicle(playerid);//get u off from the hunter
    }

    if(GetVehicleModel(vehicleid) == 520 && gPlayerClass[playerid] == SOLDIER && gPlayerClass[playerid] == SNIPER && gPlayerClass[playerid] == ENGINEER && gPlayerClass[playerid] == JETMASTER && gPlayerClass[playerid] == SPY)//if player is pilot then he can drive
    {
        SendClientMessage(playerid, COLOR_DARKGREY, "You Need to  be a Pilot to fly Hydra");//messages goes to the player that he can't drive the hydra
        RemovePlayerFromVehicle(playerid);//get u off from the hydra
    }

    if(GetVehicleModel(vehicleid) == 432 && gPlayerClass[playerid] == PILOT && gPlayerClass[playerid] == SNIPER && gPlayerClass[playerid] == SOLDIER && gPlayerClass[playerid] == JETMASTER && gPlayerClass[playerid] == SPY)//if player is Soldier then he can drive
    {
        SendClientMessage(playerid, COLOR_DARKGREY, "You Need to  be a Engineer to drive Tank");//messages goes to the player that he can't drive the tank or rhino
        RemovePlayerFromVehicle(playerid);//get u off from the tank or rhino
    }

    if(GetVehicleModel(vehicleid) == 447 && gPlayerClass[playerid] == SOLDIER && gPlayerClass[playerid] == SNIPER && gPlayerClass[playerid] == ENGINEER && gPlayerClass[playerid] == JETMASTER && gPlayerClass[playerid] == SPY)//if player is pilot then he can drive
    {
        SendClientMessage(playerid, COLOR_DARKGREY, "You Need to  be a Pilot to fly Sea Sparrow");//messages goes to the player that he can't drive the tank or sea sparrow
        RemovePlayerFromVehicle(playerid);//get u off from the sea sparrow
    }
	return 1;
}
plz help me
Reply
#38

Quote:
Originally Posted by usamahifi
View Post
hi bro this is awsome tutorial for class system n its work for me " +REP " but i have a problem i can fly hunter, hydra, sea sparrow n can drive rhino if i have selected solder class can u help me??

my code

Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new vehicleid = GetPlayerVehicleID(playerid);//variable to get vehicle ids
    if(GetVehicleModel(vehicleid) == 425 && gPlayerClass[playerid] == SOLDIER && gPlayerClass[playerid] == SNIPER && gPlayerClass[playerid] == ENGINEER && gPlayerClass[playerid] == JETMASTER && gPlayerClass[playerid] == SPY)//if player is pilot then he can drive
    {
        SendClientMessage(playerid, COLOR_RED, "You Need to  be a Pilot to fly Hunter");//messages goes to the player that he can't drive the hunter
        RemovePlayerFromVehicle(playerid);//get u off from the hunter
    }

    if(GetVehicleModel(vehicleid) == 520 && gPlayerClass[playerid] == SOLDIER && gPlayerClass[playerid] == SNIPER && gPlayerClass[playerid] == ENGINEER && gPlayerClass[playerid] == JETMASTER && gPlayerClass[playerid] == SPY)//if player is pilot then he can drive
    {
        SendClientMessage(playerid, COLOR_DARKGREY, "You Need to  be a Pilot to fly Hydra");//messages goes to the player that he can't drive the hydra
        RemovePlayerFromVehicle(playerid);//get u off from the hydra
    }

    if(GetVehicleModel(vehicleid) == 432 && gPlayerClass[playerid] == PILOT && gPlayerClass[playerid] == SNIPER && gPlayerClass[playerid] == SOLDIER && gPlayerClass[playerid] == JETMASTER && gPlayerClass[playerid] == SPY)//if player is Soldier then he can drive
    {
        SendClientMessage(playerid, COLOR_DARKGREY, "You Need to  be a Engineer to drive Tank");//messages goes to the player that he can't drive the tank or rhino
        RemovePlayerFromVehicle(playerid);//get u off from the tank or rhino
    }

    if(GetVehicleModel(vehicleid) == 447 && gPlayerClass[playerid] == SOLDIER && gPlayerClass[playerid] == SNIPER && gPlayerClass[playerid] == ENGINEER && gPlayerClass[playerid] == JETMASTER && gPlayerClass[playerid] == SPY)//if player is pilot then he can drive
    {
        SendClientMessage(playerid, COLOR_DARKGREY, "You Need to  be a Pilot to fly Sea Sparrow");//messages goes to the player that he can't drive the tank or sea sparrow
        RemovePlayerFromVehicle(playerid);//get u off from the sea sparrow
    }
	return 1;
}
plz help me
Actually, i have to commit that code was and is poor. I wrote it when i was learning. I will be improving on that in future.
Reply
#39

Hey, why you fucking bump ma topic??

This is shit tutorial.
Reply
#40

hmmm
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)