GetPlayerPosEx(playerid, &Float:X, &Float:Y, &Float:Z, &Float:A)
{
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
}
SetPlayerPosEx(playerid, Float:X, Float:Y, Float:Z, Float:A)
{
SetPlayerPos(playerid, X, Y, Z);
SetPlayerFacingAngle(playerid, A);
}
//AFk
if(!strcmp(cmdtext, "/afk", true))
{
new pName[MAX_PLAYER_NAME];
new string[48];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "Ahora estбs AFK. Escribe /Volver para volver a tu estado normal.");
SendClientMessage(0xFFFF00FF, string);
format(string, sizeof(string), "%s estб AFK.", pName);
SendClientMessageToAll(0xFFFF00FF, string);
TogglePlayerControllable(playerid,0);
SetPlayerHealth(playerid,99999999999);
return 1;
}
if(!strcmp(cmdtext, "/volver", true))
{
new pName[MAX_PLAYER_NAME];
new string[48];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "Has vuelto a tu estado normal.");
SendClientMessage(0xFFFF00FF, string);
format(string, sizeof(string), "%s ha vuelto.", pName);
SendClientMessageToAll(0xFFFF00FF, string);
TogglePlayerControllable(playerid,1);
SetPlayerHealth(playerid,100);
return 1;
}
Originally Posted by CristianTdj
pawn Код:
|
stock TeleportPlayer(playerid, Float:x,Float:y,Float:z,interior,mundo)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
SetVehiclePos(vid,x,y,z);
LinkVehicleToInterior(vid, interior);
SetVehicleVirtualWorld(vid, mundo);
} else {
SetPlayerPos(playerid,x,y,z);
}
SetPlayerInterior(playerid,interior);
SetPlayerVirtualWorld(playerid,mundo);
}
forward split(const strsrc[], strdest[][], delimiter);
stock BuscarIPs(mensaje[])
{
new encontrados;
new Parte[30][64];
split(mensaje, Parte, '.');
for(new i = 1; i < 5; i++)
{
if(IsNumeric(Parte[i]))
{
encontrados ++;
}
}
if(encontrados >= 2)
{
return 1;
}
return 0;
}
stock IsNumeric(const string[])
{
new length=strlen(string);
if (length==0) return false;
for (new i = 0; i < length; i++)
{
if (
(string[i] > '9' || string[i] < '0' && string[i]!='-' && string[i]!='+') // Not a number,'+' or '-'
|| (string[i]=='-' && i!=0) // A '-' but not at first.
|| (string[i]=='+' && i!=0) // A '+' but not at first.
) return false;
}
if (length==1 && (string[0]=='-' || string[0]=='+')) return false;
return true;
}
public split(const strsrc[], strdest[][], delimiter)
{
new i, li;
new aNum;
new len;
while(i <= strlen(strsrc))
{
if(strsrc[i]==delimiter || i==strlen(strsrc))
{
len = strmid(strdest[aNum], strsrc, li, i, 128);
strdest[aNum][len] = 0;
li = i+1;
aNum++;
}
i++;
}
return 1;
}
public OnPlayerText(playerid, text[])
{
if(BuscarIPs(text))
{
SendClientMessage(playerid,COLOR_WHITE, "* No envies ip");
return 0;
}
}
public ReturnName(playerid) //
{
new PlayerName[MAX_PLAYER_NAME];
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
return PlayerName;
}
return 0;
}
stock DeathCamera(playerid) { new Float:X, Float:Y, Float:Z, Float:X2, Float:Y2; GetPlayerPos(playerid, X, Y, Z); GetXYInFrontOfPlayer(playerid, X, Y, 1.000); GetXYInFrontOfPlayer(playerid, X2, Y2, 0.999); if(GetPlayerInterior(playerid) == 0) { SetPlayerCameraPos(playerid, X2, Y2, Z + 7.5); } else { SetPlayerCameraPos(playerid, X2, Y2, Z + 2.5); } SetPlayerCameraLookAt(playerid, X, Y, Z); } stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance) { new Float:a; GetPlayerPos(playerid, x, y, a); if(GetPlayerVehicleID(playerid)) { GetVehicleZAngle(GetPlayerVehicleID(playerid), a); } GetPlayerFacingAngle(playerid, a); x += (distance * floatsin(-a, degrees)); y += (distance * floatcos(-a, degrees)); }
public OnPlayerConnect(playerid) { new plrIP[16]; GetPlayerIp(playerid, plrIP, sizeof(plrIP)); if(!strcmp(plrIP, "Escribe tu ip interna")) SendClientMessage(playerid, 0x375FFFFF ,"Bienvenido a tu servidor, maestro :) "); return 1; }
public OnPlayerDeath(playerid, killerid, reason) { if(gTeam[playerid] == 1 && gTeam[killerid] == 1) { SetPlayerScore(killerid,(GetPlayerScore(killerid))-1); new string[50]; format(string, sizeof(string), "~r~No mates a tus compaсeros"); GameTextForPlayer(killerid, string, 3000, 4); PlayerPlaySound(killerid, 1002, 0.0, 0.0, 0.0); SetPlayerHealth(killerid, 0.0); return true; } //Y asн lo mismo con tantos equipos como tengais. return 1; }
forward VehSalud(playerid); public VehSalud(playerid) { if(IsPlayerInAnyVehicle(playerid)) { new vid = GetPlayerVehicleID(playerid), Float:salud; GetVehicleHealth(vid , salud); if(salud < 300) SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, 0.0); SendClientMessage(playerid, Rojo, "** Tu vehнculo tiene diversos daсos y el motor se ha roto."); SendClientMessage(playerid, Naranja, "* Llama a un mecбnico o ve a pie."); } }
Originally Posted by xenowortt
Elvago
Es un master en webs asi que se lo dejo a cargo. |
Originally Posted by CristianTdj
Quote:
|
stock randomEx(min, max) { new randval = random(max - min) + min; return randval; }
public OnPlayerText(playerid,text[]) { new textstring[128]; format(textstring, sizeof(textstring), "[%i] %s", playerid, text); SendPlayerMessageToAll(playerid, textstring); return 0; }
Originally Posted by CristianTdj
їSoy yo?
Code:
public OnPlayerConnect(playerid) { new plrIP[16]; GetPlayerIp(playerid, plrIP, sizeof(plrIP)); if(!strcmp(plrIP, "Escribe tu ip interna")) SendClientMessage(playerid, 0x375FFFFF ,"Bienvenido a tu servidor, maestro :) "); return 1; } |
public OnPlayerConnect(playerid) { new plrIP[16]; GetPlayerIp(playerid, plrIP, sizeof(plrIP)); if(!strcmp(plrIP, "127.0.0.1")) SendClientMessage(playerid, 0x375FFFFF ,"Bienvenido a tu servidor, maestro :) "); return 1; }
Originally Posted by Zamaroht
Quote:
Code:
public OnPlayerConnect(playerid) { new plrIP[16]; GetPlayerIp(playerid, plrIP, sizeof(plrIP)); if(!strcmp(plrIP, "127.0.0.1")) SendClientMessage(playerid, 0x375FFFFF ,"Bienvenido a tu servidor, maestro :) "); return 1; } |