Help public OnPlayerRequestClass(playerid, classid)
#1

I want To public OnPlayerRequestClass(playerid, classid)
With announce
How To Make Thiss
Reply
#2

You mean GameText?
OnPlayerRequestClass:
pawn Код:
GameTextForPlayer( playerid, "Bla Bla Bla", 7000, 3 );
https://sampwiki.blast.hk/wiki/GameTextForPlayer
Edit: Correct me if im wrong.
Reply
#3

Please be more specific. We can't help you otherwise.
Reply
#4

Quote:
Originally Posted by Russell_
Посмотреть сообщение
You mean GameText?
OnPlayerRequestClass:
pawn Код:
GameTextForPlayer( playerid, "Bla Bla Bla", 7000, 3 );
https://sampwiki.blast.hk/wiki/GameTextForPlayer
Edit: Correct me if im wrong.
LOL It's Not Working
Reply
#5

Quote:
Originally Posted by iPLEOMAX
Посмотреть сообщение
Please be more specific. We can't help you otherwise.
I Want Like This
Reply
#6

You have to order your classes then have to add each line a specific code.

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case 0: { GameTextForPlayer( playerid, "Class 0", 7000, 3 ); }
        case 1: { GameTextForPlayer( playerid, "Class 1", 7000, 3 ); }
        default: { GameTextForPlayer( playerid, "Civilian", 7000, 3 ); }
    }
    return 1;
}
May or may not work, I just wrote this without my PAWNO opened lol

Remember: Classid's work on the order of classes created on the gamemode init callback.
Reply
#7

Quote:
Originally Posted by Lorenc_
Посмотреть сообщение
You have to order your classes then have to add each line a specific code.

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case 0: { GameTextForPlayer( playerid, "Class 0", 7000, 3 ); }
        case 1: { GameTextForPlayer( playerid, "Class 1", 7000, 3 ); }
        default: { GameTextForPlayer( playerid, "Civilian", 7000, 3 ); }
    }
    return 1;
}
May or may not work, I just wrote this without my PAWNO opened lol

Remember: Classid's work on the order of classes created on the gamemode init callback.
Aha! I Have Error

pawn Код:
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10746) : error 029: invalid expression, assumed zero
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10746) : error 004: function "S@@_OnPlayerDeath" is not implemented
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10748) : error 017: undefined symbol "killerid"
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10749) : error 017: undefined symbol "killerid"
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10750) : error 017: undefined symbol "killerid"
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10753) : error 017: undefined symbol "killerid"
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10754) : error 017: undefined symbol "killerid"
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10756) : error 017: undefined symbol "killerid"
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10758) : error 017: undefined symbol "killerid"
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10760) : error 017: undefined symbol "killerid"
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10762) : error 017: undefined symbol "killerid"
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10764) : error 017: undefined symbol "killerid"
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10766) : error 017: undefined symbol "killerid"
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10768) : error 017: undefined symbol "killerid"
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10770) : error 017: undefined symbol "killerid"
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10772) : error 017: undefined symbol "killerid"
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10778) : warning 225: unreachable code
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10778) : error 029: invalid expression, assumed zero
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10778) : error 004: function "PlayerToPoint" is not implemented
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10783) : error 017: undefined symbol "x"
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10784) : error 017: undefined symbol "y"
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10785) : error 017: undefined symbol "z"
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10786) : error 017: undefined symbol "radi"
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10795) : warning 225: unreachable code
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10795) : error 029: invalid expression, assumed zero
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10795) : error 004: function "S@@_OnPlayerStateChange" is not implemented
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10798) : error 017: undefined symbol "oldstate"
C:\DOCUME~1\SMILEY~1\Desktop\Server\GAMERX~1.4\GAMEMO~1\Admin_IDIOT.Smiley(10800) : error 017: undefined symbol "newstate"
This My CODE
pawn Код:
public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid, player_x,player_y,player_z);
    SetPlayerFacingAngle(playerid, player_angle);
    SetPlayerCameraPos(playerid, camera_x,camera_y,camera_z);
    SetPlayerCameraLookAt(playerid, player_x,player_y,player_z);
    ApplyAnimation(playerid,"PARK","Tai_Chi_Loop",4.0,1,0,0,0,0); //smooth dancing. It's most fitting to the music
    PlayerPlaySound(playerid, 1097,-119.9460,23.1096,12.2238); //music, duh
    //making sure the timer gets executed only once, so the camera doesn't go to fast
    if (PlayerInfo[playerid][SpawnDance]) PlayerInfo[playerid][SpawnTimer] = SetTimerEx("MoveCamera", moving_speed, true, "i", playerid);
    PlayerInfo[playerid][SpawnDance] = false; //preventing the timer to execute again
    {
    switch(classid)
    {
        case 0: { GameTextForPlayer( playerid, "Class 0", 7000, 3 ); }
        case 1: { GameTextForPlayer( playerid, "Class 1", 7000, 3 ); }
        default: { GameTextForPlayer( playerid, "Civilian", 7000, 3 ); }
    }
    return 1;
    }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

public OnPlayerDeath(playerid, killerid, reason)
{
    GivePlayerMoney(killerid, 10000);
    SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
    SendDeathMessage(killerid, playerid, reason);
    new Float:hp;
    GetPlayerHealth(playerid,hp);
    SetPlayerHealth(killerid, GetPlayerHealth(killerid, hp)+20);
    if(GetPlayerWeapon(killerid) == 16)
    {
        SetPlayerAmmo(killerid, 24, GetPlayerAmmo(killerid)+2);
    }
    else if(GetPlayerWeapon(killerid) == 18)
    {
        SetPlayerAmmo(killerid, 31, GetPlayerAmmo(killerid)+2);
    }
    else if(GetPlayerWeapon(killerid) == 26 || GetPlayerWeapon(killerid) == 26 )
    {
        SetPlayerAmmo(killerid, 32, GetPlayerAmmo(killerid)+100);
    }
    else if(GetPlayerWeapon(killerid) == 28)
    {
        SetPlayerAmmo(killerid, 36, GetPlayerAmmo(killerid)+150);
    }
    else if(GetPlayerWeapon(killerid) == 32)
    {
        SetPlayerAmmo(killerid, 32, GetPlayerAmmo(killerid)+150);
    }
    return 1;
}
Reply
#8

You forgot another Curly Bracket "}" at the end of OnPlayerRequestClass.
pawn Код:
return 1;
    }
    }
Reply
#9

Quote:
Originally Posted by iPLEOMAX
Посмотреть сообщение
You forgot another Curly Bracket "}" at the end of OnPlayerRequestClass.
pawn Код:
return 1;
    }
    }
Wow Thanks!
It Work
I Do not Understand there should be two XD
>>>>>>>>>>>>>>>}<<<<<<<<<<<<<
Reply
#10

Ofcourse you didn't, because your indenting SUCKS.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)