14.10.2011, 20:35
can you help me how to make teleports?
like /race
thank you very much if u help!
like /race
thank you very much if u help!
if (strcmp(cmdtext, "/race", true) == 0) {
RemovePlayerFromVehicle(playerid);
SetPlayerPos(playerid,x,y,z);
GameTextForPlayer(playerid,"Welcome to race!",4000,6);
return 1;
}
if (!strcmp(cmdtext, "/race", true)) {
new Float:x,Float:y,Float:z;
GetPlayerPos(GOTOPLAYER,x,y,z);
if (GetPlayerState(playerid)==PLAYER_STATE_DRIVER)SetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
else SetPlayerPos(playerid,x,y,z);
return 1;
}
if (!strcmp(cmdtext, "/race", true))
{
new Float: x, Float: y, Float: z;
GetPlayerPos(GOTOPLAYER, x, y, z);
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z); }
else { SetPlayerPos(playerid, x, y, z); }
return 1;
}
CMD:race(playerid, params[])
{
new Float: x, Float: y, Float: z;
GetPlayerPos(GOTOPLAYER, x, y, z);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER_
{
SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
}
else
{
SetPlayerPos(playerid, x, y, z);
}
return 1;
}
new GOTOPLAYER;
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/race", true)) {
new Float:x,Float:y,Float:z;
GetPlayerPos(GOTOPLAYER,x,y,z);
if (GetPlayerState(playerid)==PLAYER_STATE_DRIVER)SetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
else SetPlayerPos(playerid,x,y,z);
ResetPlayerWeapons(playerid);
return 1;
}
//More
pawn Code:
|
new Float:x, Float:y, Float:z;
GetPlayerPos(GOTOPLAYER, 2057.3955, 861.6058, 6.7143,181);
if(!strcmp(cmdtext, "//race", true)){
if(!IsPlayerInAnyVehicle(playerid)){
SetPlayerPos(playerid, 0.0, 0.0, 0.0);
SetPlayerFacingAngle(playerid, 0.0);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
}
else{
new veh = GetPlayerVehicleID(playerid);
SetVehiclePos(veh, 0.0, 0.0, 0.0);
SetVehicleZAngle(veh, 0.0);
LinkVehicleToInterior(veh, 0);
SetVehicleVirtualWorld(veh, 0);
PutPlayerInVehicle(playerid, veh, 0);
}
return 1;
}
if(!strcmp(cmdtext, "//tp", true)){
SetPlayerPos(playerid, 0.0, 0.0, 0.0);//Change the Cords
SetPlayerFacingAngle(playerid, 0.0);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
return 1;
}