10.06.2017, 20:49
I want to make a system where I type in the input text of the dialog and in the stock receive this text that I typed it how do it?
My codes:
Dialog:
My Stock
My codes:
Dialog:
PHP код:
switch(dialogid){
case 4513:{
if(response){
if(!strlen(inputtext)){
SendClientMessage(playerid,-1,"Nenhum url foi digitado na input!");
return 0;
}
recebermusicayt[playerid] = strval(inputtext);
new Float:Pos[3];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
new vehicleid = GetPlayerVehicleID(playerid);
Musica[playerid] = 1;
vMusica[playerid] = 0;
}else{
}
}
}
PHP код:
forward ReceberSomVeiculo(playerid);
public ReceberSomVeiculo(playerid)
{
new cmdString[128];
EnviarSomVeiculo(playerid);
new Float:X, Float:Y, Float:Z;
GetVehiclePos(SomCarid[playerid], X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, 15.0, X, Y, Z))
{
if(Musica[playerid] == 1)
{
if(vMusica[playerid] == 0)
{
format(cmdString, sizeof(cmdString), "http://www.*******inmp3.com/fetch/?video=%s", inputtext); //Receive inputtext here!
for(new i = 0; i <MAX_PLAYERS; i++){
PlayAudioStreamForPlayer(i,cmdString);// URL 1
vMusica[playerid] = 1;
}
}
}
}else{
if(vMusica[playerid] == 1)
{
StopAudioStreamForPlayer(playerid);
Musica[playerid] = 0;
vMusica[playerid] = 0;
}
}
}