19.09.2011, 02:12
(
Последний раз редактировалось Oh; 20.09.2011 в 16:26.
)
PHP код:
if(strcmp(cmd, "/yo", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[126];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, GRIS, "Uso: /yo [Location]");
return 1;
}
else
{
format(string, sizeof(string), "|- [%d] %s -|",playerid, result);
}
new string2[128];
if(YoActivado[playerid] == 0)
{
YO[playerid] = Create3DTextLabel(string,CELESTE,30.0,40.0,50.0,20.0,0);
Attach3DTextLabelToPlayer(YO[playerid], playerid, 0.0, 0.0, 0.40);
format(string2, sizeof(string2), "New State: | %s | Use /yob to clear your current /yo.",result);
SendClientMessage(playerid, CELESTE, string2);
printf("%s to update its state to %s",NombreJugador(playerid),result);
YoActivado[playerid] = 1;
new y1,m1,d1;
new h1,mi1,s1;
getdate(y1,m1,d1);
gettime(h1,mi1,s1);
format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (state change): %s",d1,m1,y1,h1,mi1,s1,NombreJugador(playerid), result);
PublicLog(string);
}
else if(YoActivado[playerid] == 1)
{
SendClientMessage(playerid, ROJO_OSCURO, "Use /yob to clear your current /yo.");
}
}
return 1;
}
PHP код:
if(strcmp(cmd, "/amb", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[126];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, GRIS, "Uso: /envi [text]");
return 1;
}
else
{
format(string, sizeof(string), "{33CCFF}|- {FF0000}Enviroment: {33CCFF}%s -|",result);
}
if(AMBActivado[playerid] == 0)
{
new Float:RX, Float:RY, Float:RZ;
GetPlayerPos(playerid,RX,RY,RZ);
Delete3DTextLabel(AMB[playerid]);
AMB[playerid] = Create3DTextLabel(string,VERDE,RX,RY,RZ,30.0,0);
AMBActivado[playerid] = 1;
printf("%s updates his state to %s",NombreJugador(playerid),result);
new y1,m1,d1;
new h1,mi1,s1;
getdate(y1,m1,d1);
gettime(h1,mi1,s1);
format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (Enviroment): %s",d1,m1,y1,h1,mi1,s1,NombreJugador(playerid), result);
PublicLog(string);
}
else if(AMBActivado[playerid] == 1)
{
SendClientMessage(playerid, ROJO_OSCURO, "Use /envia to erase your currently Enviroment.");
}
}
return 1;
}