Little coding questions - For general minor queries 5

Hi , i have a small problem , after i login i dont spawn
Code:
stock LoadStats(playerid)
{
      /// Blabla loading variabiles and stuff
	SpawnPlayer(playerid);
	return 1;
}
Also i have :
Code:
public OnPlayerRequestClass(playerid, classid)
{
    SpawnPlayer(playerid);
	return 1;
}
But i still cant get the player to spawn after he logins

LE : Fixed , i just made a timer to show the player the login menu after 0.1 seconds
Reply

When i'm using player textdraws, do I need an array for them?
Reply

Does anyone know what could cause a player to fly upwards, when being spawned into a vehicle? (or just in general)
Reply

Quote:
Originally Posted by Redirect Left
Посмотреть сообщение
Does anyone know what could cause a player to fly upwards, when being spawned into a vehicle? (or just in general)
Do you want to know how to code this or prevent this?
Reply

Well, I thought 'what would cause' would indicate it was a problem. So I need to prevent it
Reply

Quote:
Originally Posted by Redirect Left
Посмотреть сообщение
Well, I thought 'what would cause' would indicate it was a problem. So I need to prevent it
Well personally, I ain't aware of this type of problem as I have never experienced it.

I'll give some code later which might prevent it (needs scripting + testing).
Reply

Well, It happens when I try to create a car and PutPlayerInVehicle, so I am assuming something is going wrong, but I can't figure out what. So i'm just hoping someone has experienced this and can give a reason, i've tried to use if(!IsPlayerInAnyVehicle){ // put player back in the vehicle } but that doesn't help.
Reply

Quote:
Originally Posted by [HLF]Southclaw
Посмотреть сообщение
I've seen the "flying upwards" thing happen with spectating sometimes (try to spawn the player while they are spectating and a few other conditions cause it)
Bleh, of course. You were right, I had forgot to reset their spectating to zero. Thanks.
Reply

Can UsePlayerPedAnims(); configured with plugin?
like this :

UsePlayerAnimGrp();
UseManAnimGrp();
UseWomanAnimGrp();
UseGang1AnimGrp();
UseGang2AnimGrp();
UseSWATAnimGrp();
...

Or
UsePlayerPedAnims(playerid); // for one player, not all


is it possible with plugin?
Reply

So far i can think is a No.
You can play with ApplyAnimation and some correct timing with key states and play animations but that wont do any good.
Reply

Could something block TogglePlayerControllable effects in OnPlayerSpawn/just after it? For some reason players don't freeze but the native gets called.
Reply

How would I avoid this?

pawn Код:
new arr_3D[][][] =
{
     {
          {float:12.0, float:124.1, float:14.6},
          {float:5.1,  float:15.1,   float:56.7},
          {"Hello"}
     }
};
because doing this

pawn Код:
new Float: arr_3D[][][] =
{
     {
          {12.0, 124.1, 14.6},
          {5.1,  15.1,  56.7},
          {"Hello"}
     }
};
gives a tag mismatch on the string lines.. Thanks!
Reply

Quote:
Originally Posted by [HLF]Southclaw
Посмотреть сообщение
Look up enumerators in the language pdf. You'll want two float arrays of 3 cells then a regular array for the string in the enumerator structure. And remove the third array dimension as that's handled by the enumerator.

pawn Код:
new arr[][E_DEFINITION]=
Enumerators can also make arrays appear 4 dimensional by embedding an array within the enumerator then initialising the enumerator occupying the third dimension; then you can address the "forth" dimension by using the array within the enumerator definition.

pawn Код:
enum E_4D{str1[32], str2[32]}
new arr[][][E_4D];
...
arr[0][0][str1] = "hello";
printf("%c", arr[0][0][str1][0]); // prints h
Yes, I know that! But I was asking if there was a way of doing it with an array...
Reply

I'm having a problem with the pay system for all factions. I set the payments in the .ini files. Example: LSPD.ini pay0 = 150. I save the file and then I go to restart my server and then it resets back to pay0 = 53. I don't know what the problem is. If it has something to do with the script or file but I'm not too sure. If someone is familar with the gamemode or know's what the problem is then please let me know.

GAMEMODE
Reply

Quote:
Originally Posted by ExcelGaming
Посмотреть сообщение
I'm having a problem with the pay system for all factions. I set the payments in the .ini files. Example: LSPD.ini pay0 = 150. I save the file and then I go to restart my server and then it resets back to pay0 = 53. I don't know what the problem is. If it has something to do with the script or file but I'm not too sure. If someone is familar with the gamemode or know's what the problem is then please let me know.

GAMEMODE
Your link doesn't work. Can you PM it to me please?
Reply

its from the sa-mp scripts website. copy "/post/14664/American_Roleplay/micha654/gamemodes/rp" and add it in the edn of "http://******************/"
Reply

pawn Код:
#include <a_samp>

new dimarray[][] =
{
    {10, 69, 27},
    {22, 33, 44},
    {15, 16, 9}
};

main() {}

public OnGameModeInit()
{
    PrintArray(dimarray[][0]); // How should this be?
    return 1;
}

stock PrintArray(array[3])
{
    for (new i, j = sizeof(array); i < j; i++) printf("%i", array[i]);
    return 1;
}
How could I access the second dimension and print values 10, 22 and 15?
Reply

pawn Код:
PrintArray(dimarray[0][0]); //10
PrintArray(dimarray[1][0]); //22
PrintArray(dimarray[2][0]); //15
Reply

Did you even look at the function?

Edit: Basically I could do this but I know that there must be a better way...

pawn Код:
public OnGameModeInit()
{
    const temp = sizeof(dimarray[]);
    new temparray[temp];
    for (new i; i < temp; i++) temparray[i] = dimarray[i][0];
    PrintArray(temparray);
    return 1;
}
Reply

Quote:
Originally Posted by kvann
Посмотреть сообщение
Did you even look at the function?

Edit: Basically I could do this but I know that there must be a better way...

pawn Код:
public OnGameModeInit()
{
    const temp = sizeof(dimarray[]);
    new temparray[temp];
    for (new i; i < temp; i++) temparray[i] = dimarray[i][0];
    PrintArray(temparray);
    return 1;
}
EDIT: Thank you Konstantinos, silly mistake of mine, OP - look below.
Reply


Forum Jump:


Users browsing this thread: 17 Guest(s)