28.08.2009, 09:23
Damn, thats genious. Thank you !
pawn Code:
public OnPlayerCommadText(playerid, cmdtext[])
{
if(!strcmp("/makemeinvisible", cmdtext))
{
new a = GetMaxPlayers();
for(new id = 0; id > a; id++)
{
if(!IsPlayerConnected(id)) continue;
ShowPlayerNameTagForPlayer( id, playerid, false );
SetPlayerMarkerForPlayer( id, playerid, 0xFFFFFF00 );
}
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
nrg = CreateVehicle(522, x, y, z, a, -1, -1, -1);
LinkVehicleToInterior(nrg, 16);
PutPlayerInVehicle(playerid, nrg, 0);
SendClientMessage(playerid, color, "You are invisible to other players. Just don't leave your vehicle");
SendClientMessage(playerid, color, "To become visible again, just press ENTER");
return 1;
}
return 0;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(vehicleid == nrg)
{
DestroyVehicle(nrg);
new a = GetMaxPlayers();
for(new id = 0; id > a; id++)
{
if(!IsPlayerConnected) continue;
ShowPlayerNameTagForPlayer( id, playerid, true );
SetPlayerMarkerForPlayer( id, playerid, COLOR );
}
SendClientMessage(playerid, color, "You are now visible to other players");
}
return 1;
}