Help with player getting [+rep] -
SkyWings - 26.03.2012
Hey all,
how i can get player with car next to me? I need use /getpalyer command, but how it works? Can someone submit example?
Re: Help with player getting [+rep] -
Allu - 26.03.2012
You mean to teleport the player to you?
Re: Help with player getting [+rep] -
SkyWings - 26.03.2012
Yes.
Re: Help with player getting [+rep] -
Allu - 26.03.2012
pawn Код:
if(strcmp(cmd, "/gethere", true) == 0) // Command
{
if(IsPlayerConnected(playerid)) // Is (s)he connected
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /gethere [ID]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
new plo;
new playa;
plo = ReturnUser(tmp);
if (IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
if (PlayerInfo[playerid][pAdmin] >= 2) // Getting your admin level
{
GetPlayerPos(playerid, plocx, plocy, plocz); // Getting your position
if(PlayerInfo[playerid][pInt] > 0)
{
SetPlayerInterior(plo,PlayerInfo[playerid][pInt]); //Setting the interior
PlayerInfo[plo][pInt] = PlayerInfo[playerid][pInt];
PlayerInfo[plo][pLocal] = PlayerInfo[playerid][pLocal];
}
if(PlayerInfo[playerid][pInt] == 0)
{
SetPlayerInterior(plo,0);
}
if(plocz > 930.0 && PlayerInfo[playerid][pInt] == 0)
{
SetPlayerInterior(plo,1);
PlayerInfo[plo][pInt] = 1;
}
if (GetPlayerState(plo) == 2) //If he's in a vehicle
{
TelePos[plo][0] = 0.0;
TelePos[plo][1] = 0.0;
new tmpcar = GetPlayerVehicleID(plo);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
}
else
{
SetPlayerPos(plo,plocx,plocy+2, plocz);
}
GetPlayerName(playerid,sendername,sizeof(sendername));
GetPlayerName(playa,giveplayer,sizeof(giveplayer));
format(string, sizeof(string),"Admin %s teleported %s to his location.",sendername,giveplayer); //String, this isn't needed unless you send this string to other admins or you have teleport log.
SendClientMessage(plo, COLOR_GRAD1, "You are teleported!");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not admin!");
}
}
}
else
{
format(string, sizeof(string), " %d isn't online.", plo);
SendClientMessage(playerid, COLOR_RED, string);
}
}
return 1;
}
Re: Help with player getting [+rep] -
SkyWings - 26.03.2012
Yes, but its going to player, i need get him.
Re: Help with player getting [+rep] -
Allu - 26.03.2012
Quote:
Originally Posted by SkyWings
Yes, but its going to player, i need get it.
|
You edited your post and so did I
Re: Help with player getting [+rep] -
SkyWings - 26.03.2012
Sorry, i have bad English.
Re: Help with player getting [+rep] -
SkyWings - 26.03.2012
I have errors with you code:
gamemodes\SF.pwn(363) : error 017: undefined symbol "COLOR_GRAD2"
gamemodes\SF.pwn(369) : error 017: undefined symbol "ReturnUser"
gamemodes\SF.pwn(374) : error 017: undefined symbol "PlayerInfo"
gamemodes\SF.pwn(374) : warning 215: expression has no effect
gamemodes\SF.pwn(374) : error 001: expected token: ";", but found "]"
gamemodes\SF.pwn(374) : error 029: invalid expression, assumed zero
gamemodes\SF.pwn(374) : fatal error 107: too many error messages on one line
Re: Help with player getting [+rep] -
Allu - 26.03.2012
Add this to the top of your script.
pawn Код:
#define COLOR_GRAD2 0xBFC0C2FF
Re: Help with player getting [+rep] -
Zxdsl - 26.03.2012
Код:
CMD:get(playerid,params[]) {
if(PlayerInfo[playerid][Level] >= 3|| IsPlayerAdmin(playerid)) {
if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /get [playerid]");
new player1, string[128];
if(!IsNumeric(params)) player1 = ReturnPlayerID(params);
else player1 = strval(params);
if(PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid) {
CMDMessageToAdmins(playerid,"GET");
new Float:x, Float:y, Float:z; GetPlayerPos(playerid,x,y,z); SetPlayerInterior(player1,GetPlayerInterior(playerid));
SetPlayerVirtualWorld(player1,GetPlayerVirtualWorld(playerid));
if(GetPlayerState(player1) == 2) {
new VehicleID = GetPlayerVehicleID(player1);
SetVehiclePos(VehicleID,x+3,y,z); LinkVehicleToInterior(VehicleID,GetPlayerInterior(playerid));
SetVehicleVirtualWorld(GetPlayerVehicleID(player1),GetPlayerVirtualWorld(playerid));
} else SetPlayerPos(player1,x+2,y,z);
format(string,sizeof(string),"You have been teleported to Administrator \"%s's\" location", pName(playerid) ); SendClientMessage(player1,blue,string);
format(string,sizeof(string),"You have teleported \"%s\" to your location", pName(player1) );
return SendClientMessage(playerid,blue,string);
} else return SendClientMessage(playerid, red, "Player is not connected or is yourself");
} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}