2020-10-13, 06:25 PM
(This post was last modified: 2020-10-13, 06:26 PM by DaZzY.)
Hello i have a Gamemode with many teams ... ( TDM )
And i have a team Justice with 3 skin ( cops , swat , army )
I want army skin have a different spawn position not like cops and swat? ( cops , swat , army are the same teams )
there is some of?my code :
Quote:new const Float:g_SpawnJustice[][4] = {
{-2190.1560, 613.9122,35.1641,116.1742},//
{-2185.8408, 704.4630,53.8906,248.9940},
{-2206.7517, 665.4793,49.4375,175.6908}
};
case 2: { //>>>>>>>>>> THIS case is on OnPlayerSpawn...
? ?
? /
?
? ? ? ? ? ? iRandom = random(sizeof(g_SpawnJustice));
SetPlayerPos(playerid, g_SpawnJustice[iRandom][0], g_SpawnJustice[iRandom][1], g_SpawnJustice[iRandom][2]);
SetPlayerFacingAngle(playerid, g_SpawnJustice[iRandom][3]);
}
I have used?if(GetPlayerSkin(playerid) == 287) army skin and that does'nt work??
Help please :D and i know my english sorry ...
UP :) any one know how please ?
You can create a switch for all teams then under each case, you will set the spawn for each skin.
Example:
Code: switch(PlayerInfo[playerid][pTeam]) {
? ? ? ? case 1:
? ? ? ? {
? ? ? ? ? ? ? ? ? if(GetPlayerSkin(playerid) == 287)
? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? SetPlayerPos(playerid, -2190.1560, 613.9122,35.1641,116.1742);
? ? ? ? ? ? ? ? ? }
? ? ? ? }
}
I have tried to do this but work only when military die respawn at this positon still doesn't work :(
2020-10-15, 12:09 PM
(This post was last modified: 2020-10-15, 12:12 PM by Worm.)
(2020-10-14, 12:52 PM)DaZzY Wrote:
I have tried to do this but work only when military die respawn at this positon still doesn't work :(
So according to what you are saying, It works only after the player dies.
Also by "? military ", you mean the team, or do you mean the player?
Add delay for 1 - 2 sec after OnPlayerSpawn to RE-Set player pos by skin or use SetPlayerSpawnInfo when player selects team.
2020-10-15, 01:10 PM
(This post was last modified: 2020-10-15, 01:19 PM by DaZzY.)
(2020-10-15, 12:09 PM)Worm Wrote: (2020-10-14, 12:52 PM)DaZzY Wrote:
I have tried to do this but work only when military die respawn at this positon still doesn't work :(
So according to what you are saying, It works only after the player dies.
Also by "? military ", you mean the team, or do you mean the player?
This is my code :?
Quote:switch (g_Team[g_Player[playerid][playerClass]][teamId]) {
iRandom = random(sizeof(g_SpawnJustice));
SetPlayerPos(playerid, g_SpawnJustice[iRandom][0], g_SpawnJustice[iRandom][1], g_SpawnJustice[iRandom][2]);
SetPlayerFacingAngle(playerid, g_SpawnJustice[iRandom][3]);
if(GetPlayerSkin(playerid) == 287)
? {
? SetPlayerPos(playerid, -1303.9714,492.5781,11.1953);
? }
?
i have many "case" i show this "case" of this team i have add? if(GetPlayerSkin(playerid) == 287) (military skin ) and position special to military?
When i choose player with military skin and i click on "SPAWN" on request class the military player skin spawn same position with other player of skin cops and swat But when player die with skin 287 the player spawn at position of military skin
Quote:Add delay for 1 - 2 sec after OnPlayerSpawn to RE-Set player pos by skin or use SetPlayerSpawnInfo when player selects team.
?
This maybe a good idea the timer but SetPlayerSpawnInfo doesn't work also :(
So the problem i have a same team (justice) but i want a differents position for skin ...
(2020-10-15, 01:10 PM)DaZzY Wrote: (2020-10-15, 12:09 PM)Worm Wrote: (2020-10-14, 12:52 PM)DaZzY Wrote:
I have tried to do this but work only when military die respawn at this positon still doesn't work :(
So according to what you are saying, It works only after the player dies.
Also by "?military ", you mean the team, or do you mean the player?
This is my code :?
Quote:switch (g_Team[g_Player[playerid][playerClass]][teamId]) {
iRandom = random(sizeof(g_SpawnJustice));
SetPlayerPos(playerid, g_SpawnJustice[iRandom][0], g_SpawnJustice[iRandom][1], g_SpawnJustice[iRandom][2]);
SetPlayerFacingAngle(playerid, g_SpawnJustice[iRandom][3]);
if(GetPlayerSkin(playerid) == 287)
? {
? SetPlayerPos(playerid, -1303.9714,492.5781,11.1953);
? }
?
i have many "case" i show this "case" of this team i have add? if(GetPlayerSkin(playerid) == 287) (military skin ) and position special to military?
When i choose player with military skin and i click on "SPAWN" on request class the military player? skin spawn same position with other player of skin cops and swat But when player die with skin 287 the player spawn at position of military skin
Quote:Add delay for 1 - 2 sec after OnPlayerSpawn to RE-Set player pos by skin or use SetPlayerSpawnInfo when player selects team.
?
This maybe a good idea the timer but SetPlayerSpawnInfo doesn't work also :(
So the problem i have a same team (justice) but i want a differents position for skin ...
What do u use to select teams ? Dialog or.. ?
2020-10-15, 01:30 PM
(This post was last modified: 2020-10-15, 01:31 PM by DaZzY.)
Quote:What do u use to select teams ? Dialog or.. ?
No just? the original class selection
2020-10-15, 01:40 PM
(This post was last modified: 2020-10-15, 01:43 PM by Expert*.)
PHP Code: public OnPlayerRequestSpawn(playerid) { if( IsPlayerNPC( playerid ) ) return 1;
if( GetPlayerSkin( playerid ) == 287 ) { ? ? SetSpawnInfo( playerid, 0, 0, g_SpawnJustice[ 0 ][ 0 ], g_SpawnJustice[ 0 ][ 1 ], g_SpawnJustice[ 0 ][ 2 ], g_SpawnJustice[ 0 ][ 3 ], 26, 36, 28, 150, 0, 0 ); } else if( GetPlayerSkin( playerid ) == 287 ) { ? ? SetSpawnInfo( playerid, 0, 0, g_SpawnJustice[ 1 ][ 0 ], g_SpawnJustice[ 1 ][ 1 ], g_SpawnJustice[ 1 ][ 2 ], g_SpawnJustice[ 1 ][ 3 ], 26, 36, 28, 150, 0, 0 ); } else if( GetPlayerSkin( playerid ) == 287 ) { ? ? SetSpawnInfo( playerid, 0, 0, g_SpawnJustice[ 2 ][ 0 ], g_SpawnJustice[ 2 ][ 1 ], g_SpawnJustice[ 2 ][ 2 ], g_SpawnJustice[ 2 ][ 3 ], 26, 36, 28, 150, 0, 0 ); } return 1; }
Idk if u can use this if you use class selection.
You probably only get that skin when u use class selection and spawn in to the world at least once
2020-10-15, 01:48 PM
(This post was last modified: 2020-10-15, 01:48 PM by Expert*.)
Also, u can try to change spawn pos in: AddPlayerClass.
https://www.open.mp/docs/scripting/funct...layerClass
Not working again xD the player spawn another position ( position when player bug ) but i get another idea to make military skin spawn at position
and the idea is to make a invisible checkpoint when skin 287 enter this CP he get teleported to militaryspawn so i put this CP on COPS and SWAT spawn xD
|