if(strcmp(cmdtext,"/sf", true) == 0){
if(SemLife(playerid)) return SendClientMessage(playerid, -1, "Vocк nгo pode se teleporta com vida baixa");
{
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetVehiclePos(GetPlayerVehicleID(playerid),-2006.3324,146.2305,27.5391);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), ">> %s Foi para SAN FIERRO [ /SF ]", pName);
SendClientMessageToAll(-1, string);
SetPlayerPos(playerid,-2042.2521,136.4568,28.8359);
}
return 1;
}
stock SemLife(playerid)
{
new Float:HP;
GetPlayerHealth(playerid, HP);
if(HP < 40) return 1;
return 0;
}
if(strcmp(cmdtext,"/sf", true) == 0){
if(GetPlayerHealth(playerid) < 40) return SendClientMessage(playerid, -1, "Vocк nгo pode se teleporta com vida baixa");
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetVehiclePos(GetPlayerVehicleID(playerid),-2006.3324,146.2305,27.5391);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), ">> %s Foi para SAN FIERRO [ /SF ]", pName);
SendClientMessageToAll(-1, string);
SetPlayerPos(playerid,-2042.2521,136.4568,28.8359);
return 1;
}
Tente:
pawn Код:
Desculpa se o script nгo funcionar, estou um tempo sem mexer em pawn. |
if(GetPlayerHealth(playerid) < 50) return SendClientMessage(playerid, -1, "Vocк nгo pode se teleporta com vida baixa");
if(strcmp(cmdtext,"/sf", true) == 0){
if(GetPlayerHealth(playerid) < 50) return SendClientMessage(playerid, -1, "Vocк nгo pode se teleporta com vida baixa");
SetVehiclePos(GetPlayerVehicleID(playerid),-2006.3324,146.2305,27.5391);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), ">> %s Foi para SAN FIERRO [ /SF ]", pName);
SendClientMessageToAll(-1, string);
SetPlayerPos(playerid,-2042.2521,136.4568,28.8359);
return 1;
}
if(strcmp("/sf", cmdtext, true, 10) == 0)
if(GetPlayerHealth(playerid) < 50)
{
SendClientMessage(playerid, -1, "Vocк nгo pode se teleporta com vida baixa");
}else{
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetVehiclePos(GetPlayerVehicleID(playerid),-2006.3324,146.2305,27.5391);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), ">> %s Foi para SAN FIERRO [ /SF ]", pName);
SendClientMessageToAll(-1, string);
SetPlayerPos(playerid,-2042.2521,136.4568,28.8359);
}
return 1;
}
if(!strcmp(cmdtext, "/sf", true))
{
switch(SemVida(playerid, 40))
{
case 0:
{
switch(IsPlayerInAnyVehicle(playerid))
{
case 0:
{
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid, -2042.2521, 136.4568, 28.8359);
}
case 1:
{
new vehicleid = GetPlayerVehicleID(playerid);
LinkVehicleToInterior(vehicleid, 0);
SetVehicleVirtualWorld(vehicleid, 0);
SetVehiclePos(vehicleid, -2006.3324, 146.2305, 27.5391);
}
}
new string[64];
GetPlayerName(playerid, string, sizeof(string));
format(string, sizeof(string), ">> %s Foi para SAN FIERRO [ /SF ]", string);
SendClientMessageToAll(-1, string);
}
case 1: return SendClientMessage(playerid, -1, "Vocк nгo pode se teleportar com vida baixa");
}
return 1;
}
stock SemVida(playerid, health)
{
new Float:tmphealth;
GetPlayerHealth(playerid, tmphealth);
if(tmphealth < health) return 1;
return 0;
}
Sempre й bom indentar o code
Tenta assim: pawn Код:
|
que isso cara, ta errado essa logica.
vc deveria primeiro vereficar se o player ta em veiculo ou nao e se sim setar a posicao do carro em 1 local X se nao tiver em carro, setar so o player nas cordenadas X repara isso ae. |
This forum requires that you wait 240 seconds between posts. Please try again in 50 seconds. |
if(strcmp(cmdtext,"/sf", true) == 0)
if(SemVida(playerid)) return SendClientMessage(playerid, -1, "Vocк nгo pode se teleporta com vida baixa");
else{
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), ">> %s foi para SAN FIERRO [ /SF ] ", pName);
SendClientMessageToAll(-1, string);
SetPlayerInterior(playerid,0);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER){
SetVehiclePos(GetPlayerVehicleID(playerid),-2006.3324,146.2305,27.5391);
SetVehicleZAngle(GetPlayerVehicleID(playerid),87.9631);}else{
SetPlayerPos(playerid,-2042.2521,136.4568,28.8359);SetCameraBehindPlayer(playerid);
SetPlayerFacingAngle(playerid,87.9631);
SetCameraBehindPlayer(playerid);
}
return 1;
}