new Float:specatorX, Float:specatorY, Float:specatorZ; new interior; new virtualworld;
dcmd_specplayer(playerid, params[])
{
new Giveplayerid, Name[256], String[256], Name2[256];
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if (sscanf(params, "d", Giveplayerid)) SendClientMessage(playerid,COLOR_WHITE, "SERVER: /specplayer [Playerid]");
else if (!IsPlayerConnected(Giveplayerid)) SendClientMessage(playerid,COLOR_PURPLE,"Player not connected?");
else
{
if ( Specing[Giveplayerid] == 1 )
{
SendClientMessage(playerid, COLOR_RED, " The person you have tried to spec is spectating someone else.");
}
else
{
GetPlayerName(playerid, Name, 256);
GetPlayerName(Giveplayerid, Name2, 256);
format(String, 256, "[%i] %s is now spectating [%i] %s",playerid, Name,Giveplayerid, Name2);
CallLocalFunction("ircRemoteSay", "iss", 1, "#FSE", String);
Specing[playerid] = 1;
}
SpecAndmed(playerid);
if ( !IsPlayerInAnyVehicle(Giveplayerid) )
{
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, Giveplayerid);
SetPlayerInterior(playerid,GetPlayerInterior(Giveplayerid));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Giveplayerid));
return 1;
}
else
{
TogglePlayerSpectating(playerid, 1);
PlayerSpectateVehicle(playerid, GetPlayerVehicleID(Giveplayerid));
SetPlayerInterior(playerid,GetPlayerInterior(Giveplayerid));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Giveplayerid));
return 1;
}
}
}
return 1;
}
dcmd_specoff(playerid, params[])
{
#pragma unused params
TogglePlayerSpectating(playerid, 0);
Specing[playerid] = 0;
SetPlayerHealth(playerid, 100.0);
SetPlayerPos(playerid, specatorX, specatorY, specatorZ);
SetPlayerInterior(playerid, interior);
SetPlayerVirtualWorld(playerid, virtualworld);
return 1;
}
public SpecAndmed(playerid)
{
GetPlayerPos(playerid, specatorX, specatorY, specatorZ);
new interior = GetPlayerInterior(playerid);
new virworld = GetPlayerVirtualWorld(playerid);
return 1;
}
C:\Documents and Settings\Kasutaja\My Documents\SAMP\gamemodes\sg.pwn(46308) : warning 219: local variable "interior" shadows a variable at a preceding level C:\Documents and Settings\Kasutaja\My Documents\SAMP\gamemodes\sg.pwn(46309) : warning 204: symbol is assigned a value that is never used: "virworld" C:\Documents and Settings\Kasutaja\My Documents\SAMP\gamemodes\sg.pwn(46308) : warning 204: symbol is assigned a value that is never used: "interior" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase Header size: 9588 bytes Code size: 1640064 bytes Data size: 10376316 bytes Stack/heap size: 16384 bytes; estimated max. usage=5601 cells (22404 bytes) Total requirements:12042352 bytes 3 Warnings.
|
Originally Posted by [AC
Etch ]
new interior = GetPlayerInterior(playerid); new virworld = GetPlayerVirtualWorld(playerid); it means that u didn't use those lines above |
|
Originally Posted by [AC
Etch ]
delete those 2 lines cause u don't use them : new interior = GetPlayerInterior(playerid); new virworld = GetPlayerVirtualWorld(playerid); |
public SpecAndmed(playerid)
{
GetPlayerPos(playerid, specatorX, specatorY, specatorZ);
interior = GetPlayerInterior(playerid);
virtualworld = GetPlayerVirtualWorld(playerid);
return 1;
}
|
Originally Posted by MadeMan
pawn Код:
|
|
Originally Posted by MadeMan
You have to return the player to his position under OnPlayerSpawn.
|