Author Topic: where I made a mistake ?  (Read 2695 times)

[EG]~[S]aha~

  • Jr. Member
  • **
  • Posts: 54
  • Karma: +1/-9
  • Liberty Unleashed!
    • View Profile
where I made a mistake ?
« on: December 30, 2012, 04:09:09 pm »
function GetIslandName( i )
{
   switch ( i )
   {
      case 1:
         return "Portland";
      case 2:
         return "Staunton Island";
      case 3:
         return "Shoreside Vale";
   }
   
   return "Unknown";
}
 
function onPlayerIslandChange( player, old, new )
{
PagerMessage( pPlayer, szYour have entered " + GetIslandName( new ), 140, 1, 2 );
     
     return 1;
}
 

IdkanYavuk X

  • Jr. Member
  • **
  • Posts: 91
  • Karma: +37/-36
  • Developer for The Newport Experience
    • View Profile
Re: where I made a mistake ?
« Reply #1 on: December 30, 2012, 07:38:09 pm »
function onPlayerIslandChange( player, old, new )
{
PagerMessage( pPlayer, szYour have entered " + GetIslandName( new ), 140, 1, 2 );
     
     return 1;
}
 

Code: [Select]
function onPlayerIslandChange( player, old, new )
{
PagerMessage( player, "You have entered " + GetIslandName( new ), 140, 1, 2 );
     
     return 1;
}

[EG]~[S]aha~

  • Jr. Member
  • **
  • Posts: 54
  • Karma: +1/-9
  • Liberty Unleashed!
    • View Profile
Re: where I made a mistake ?
« Reply #2 on: December 30, 2012, 09:54:27 pm »
it does not work! :(

IdkanYavuk X

  • Jr. Member
  • **
  • Posts: 91
  • Karma: +37/-36
  • Developer for The Newport Experience
    • View Profile
Re: where I made a mistake ?
« Reply #3 on: December 30, 2012, 10:04:02 pm »
OK, this is tested:

Code: [Select]
function GetIslandName( i )
{
local island = "";
switch( i )
{
case 0: island = "Liberty City";
break;
case 1: island = "Portland Island";
break;
case 2: island = "Staunton Island";
break;
case 3: island = "Shoreside Vale";
break;
}
return island
}

function onPlayerIslandChange( player, old, new )
{
         PagerMessage( player, "You have entered " + GetIslandName( new ), 140, 1, 2 );
         return 1;
}

Good luck!

[EG]~[S]aha~

  • Jr. Member
  • **
  • Posts: 54
  • Karma: +1/-9
  • Liberty Unleashed!
    • View Profile
Re: where I made a mistake ?
« Reply #4 on: January 03, 2013, 11:26:48 am »
Thanks but it is buggy! since I changed the player screen and it works well laganuto skipt good + 5

IdkanYavuk X

  • Jr. Member
  • **
  • Posts: 91
  • Karma: +37/-36
  • Developer for The Newport Experience
    • View Profile
Re: where I made a mistake ?
« Reply #5 on: January 03, 2013, 07:10:04 pm »
Explain the buggy part, I didn't understand you

 

© Liberty Unleashed Team.