CMD:teleplayer(playerid, params[])
{
new id;
new PlayerName[24], str_[62];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED1,"[ ! ] USAGE: /teleplayer <playerid> <placename>");
format(str_, sizeof(str_), "[ ! ] %s has teleported you !", PlayerName);
SendClientMessage(id, COLOR_RED1, str_);
SetPlayerPos(id, 1721.9911,-1608.1677,13.5469); //Change X,Y,Z Co-ordinates to what place you want the player to be teleported and type /save
SetPlayerInterior(id, 0); //Change Interiors....(Check Interiors where you do /save by doing /interior or Search in ******.
// Add more Places here...and name them as you want...
return 1;
}
Ofcourse You can co do that.
pawn Код:
|
CMD:teleplayer(playerid, params[])
{
if(IsPlayerAdmin(playerid))// Edit this to work with your admin system, If you have one..
{
new id;
new PlayerName[24], str_[62];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED1,"USAGE: /teleplayer <playerid> <placename>");
format(str_, sizeof(str_), "%s has teleported you !", PlayerName);
SendClientMessage(id, COLOR_RED1, str_);
SetPlayerPos(id, 1721.9911,-1608.1677,13.5469); //Change X,Y,Z Co-ordinates to what place you want the player to be teleported and type /save
SetPlayerInterior(id, 0); //Change Interiors....(Check Interiors where you do /save by doing /interior or Search in ******.
}
return 1;
}
}
That'll make every player able to use it, Which he doesn't want...
Okay there are two ways, 1.you can save the Bank's X,Y,Z on the gang and then put it on the script and do it to teleport the player to that position... 2.Or to type the coords on the command ingame, What way would you like ? If the first one, Then MAFIAWARS's command would be good, But you'll need to add the stuff to make only admins able to do it, I edit it for you pawn Код:
|
I don't know its Player Information and Admin System, That is why I didn't put... |
CMD:teleplayer(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You're not authorized to use this command."); // change this to your own admin variable that you're using
new giveplayerid, place[50];
if(sscanf(params, "us[50]", giveplayerid, place))
{
SendClientMessage(playerid, 0xFFFFFFFF, "Correct usage: /teleplayer [playerid/name] [place]");
SendClientMessage(playerid, 0xFFFFFFFF, "Available places are: bank, lspd"); // add your own here
return 1;
}
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFFFFF, "Error: Player not connected.");
if(strcmp(place, "bank"))
{
SetPlayerPos(giveplayerid, 0.0, 0.0, 0.0); // replace the 0.0's with the bank's X Y and Z
}
else if(strcmp(place, "lspd"))
{
SetPlayerPos(giveplayerid, 0.0, 0.0, 0.0); // replace the 0.0's with the lspd's X Y and Z
}
else
{
SendClientMessage(playerid, 0xFFFFFFFF, "Error: Invalid teleport place.");
SendClientMessage(playerid, 0xFFFFFFFF, "Available places are: bank, lspd"); // add your own here
}
return 1;
}
else if(strcmp(place, "newplace"))
{
SetPlayerPos(giveplayerid, 0.0, 0.0, 0.0); // replace the 0.0's with the new place's X Y and Z
}
CMD:teleplayer(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return 0; // change this to your own admin variable that you're using
new giveplayerid, place[50];
if(sscanf(params, "us[50]", giveplayerid, place))
{
SendClientMessage(playerid, 0xFFFFFFFF, "Correct usage: /teleplayer [playerid/name] [place]");
SendClientMessage(playerid, 0xFFFFFFFF, "Available places are: bank, lspd"); // add your own here
return 1;
}
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFFFFF, "Error: Player not connected.");
if(strcmp(place, "bank"))
{
SetPlayerPos(giveplayerid, 0.0, 0.0, 0.0); // replace the 0.0's with the bank's X Y and Z
}
else if(strcmp(place, "lspd"))
{
SetPlayerPos(giveplayerid, 0.0, 0.0, 0.0); // replace the 0.0's with the lspd's X Y and Z
}
else if(strcmp(place, "newplace"))
{
SetPlayerPos(giveplayerid, 0.0, 0.0, 0.0); // replace the 0.0's with the new place's X Y and Z
}
else
{
SendClientMessage(playerid, 0xFFFFFFFF, "Error: Invalid teleport place.");
SendClientMessage(playerid, 0xFFFFFFFF, "Available places are: bank, lspd"); // add your own here
}
return 1;
}
CMD:sendtobank(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 3)
{
new string[128], giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "PEMAKAIAN: /sendtobank [playerid]");
if(IsPlayerConnected(giveplayerid))
{
if (PlayerInfo[giveplayerid][pAdmin] >= )//Here Your Admin Level
{
SendClientMessageEx(playerid, COLOR_GRAD1, "Anda tidak cukup level admin untuk menggunakan perintah ini!");
return 1;
}
format(string, sizeof(string), " Anda telah mengirim %s Ke Bank.", GetPlayerNameEx(giveplayerid));
SendClientMessageEx(playerid, COLOR_WHITE, string);
SendClientMessageEx(giveplayerid, COLOR_GRAD1, " Anda telah di teleportasi ke Bank!");
SetPlayerPos(giveplayerid, //YOUR COORDINAT HERE);
SetPlayerVirtualWorld(giveplayerid, 0);
SetPlayerInterior(giveplayerid, 0);
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "Anda tidak memiliki wewenang untuk menggunakan perintah ini!");
}
return 1;
}
pawn Код:
|
Last post was nearly a week ago, and the last post was telling the person exactly what he wanted, i.e. a /teleplayer [playerid] [place]. Your command's not even fitting the needs of what the guy wants. Anyway, be a bit more careful next time before you post and check the dates.
|