#1

Hello Friends!

I want to create new spec system. When we do /spec and then when we off /specoff i want to back that place where we start using /spec without spawning at base.

Sorry my speaking English language skills is not so good..

Regards Humza,
Reply
#2

1: Make the command /spec normally, and test to see if it works.
2: Before you using PlayerSpectatingPlayer and TogglePlayerSpectating, save the previous position to a global variable allocated to the player.
3: Make the command /specoff, it would disable TogglePlayerSpectating and it would use SetPlayerPos to the old player's position using the global variables allocated to the player in step 2.
Reply
#3

Quote:
Originally Posted by DanishHaq
Посмотреть сообщение
1: Make the command /spec normally, and test to see if it works.
2: Before you using PlayerSpectatingPlayer and TogglePlayerSpectating, save the previous position to a global variable allocated to the player.
3: Make the command /specoff, it would disable TogglePlayerSpectating and it would use SetPlayerPos to the old player's position using the global variables allocated to the player in step 2.
Can u send me code please because i am new in pawno
Reply
#4

pawn Код:
new Float:SpecX,Float:SpecY,Float:SpecZ;
CMD:spec(playerid, params[])
{
    new id;
    new str[128];
    if(sscanf(params, "u", id))return SendClientMessage(playerid, COLOR_RED, "Error: USAGE: /Spec [ID]");
    if(!IsPlayerConnected(id))return SendClientMessage(playerid, COLOR_RED, "Error: Player is not connected!");
    GetPlayerPos(playerid,SpecX,SpecY,SpecZ);
    TogglePlayerSpectating(playerid, 1);
    PlayerSpectatePlayer(playerid, id);
    SetPlayerInterior(playerid, GetPlayerInterior(id));
    return 1;
}
CMD:specoff(playerid, params[])
{
    TogglePlayerSpectating(playerid, 0);
    SetPlayerPos(playerid,SpecX,SpecY,SpecZ);
    return 1;
}
Reply
#5

Quote:
Originally Posted by gurmani11
Посмотреть сообщение
pawn Код:
new Float:SpecX,Float:SpecY,Float:SpecZ;
CMD:spec(playerid, params[])
{
    new id;
    new str[128];
    if(sscanf(params, "u", id))return SendClientMessage(playerid, COLOR_RED, "Error: USAGE: /Spec [ID]");
    if(!IsPlayerConnected(id))return SendClientMessage(playerid, COLOR_RED, "Error: Player is not connected!");
    GetPlayerPos(playerid,SpecX,SpecY,SpecZ);
    TogglePlayerSpectating(playerid, 1);
    PlayerSpectatePlayer(playerid, id);
    SetPlayerInterior(playerid, GetPlayerInterior(id));
    return 1;
}
CMD:specoff(playerid, params[])
{
    TogglePlayerSpectating(playerid, 0);
    SetPlayerPos(playerid,SpecX,SpecY,SpecZ);
    return 1;
}
it showing 7 errors
Reply
#6

show them dont say...
Reply
#7

Quote:
Originally Posted by gurmani11
Посмотреть сообщение
pawn Код:
new Float:SpecX,Float:SpecY,Float:SpecZ;
CMD:spec(playerid, params[])
{
    new id;
    new str[128];
    if(sscanf(params, "u", id))return SendClientMessage(playerid, COLOR_RED, "Error: USAGE: /Spec [ID]");
    if(!IsPlayerConnected(id))return SendClientMessage(playerid, COLOR_RED, "Error: Player is not connected!");
    GetPlayerPos(playerid,SpecX,SpecY,SpecZ);
    TogglePlayerSpectating(playerid, 1);
    PlayerSpectatePlayer(playerid, id);
    SetPlayerInterior(playerid, GetPlayerInterior(id));
    return 1;
}
CMD:specoff(playerid, params[])
{
    TogglePlayerSpectating(playerid, 0);
    SetPlayerPos(playerid,SpecX,SpecY,SpecZ);
    return 1;
}
You need to use per player variables, those are server wide, so if two people were spectating the first guy would be set to the second guys position
Reply
#8

Friends Thanks for ur support i make it
Thanks for all <3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)