Sorry for double post, I managed to connect and send/recieve data on samp server via custom c# application.
Now I have a question, this variable that I send to sa-mp server is global, right?
How will I make that user who use application send that variable to server, connects to it (i did that) and make it only for that playerid in script. This what I did is global.
Please, look at my code:
Код:
public onSocketReceiveData(Socket:id, remote_clientid, data[], data_len)
{
printf("Remote client [%d] has sent: %d", remote_clientid, data); // id & data
socket_launcher[remote_clientid] = strval(data);
return 1;
}
Than I put under OnPlayerConnect:
Код:
new string[100];
format(string, sizeof(string), "Var socket_launcher is set on: %d", socket_launcher[playerid]);
SendClientMessage(playerid, COLOR_WHITE, string);
if(socket_launcher[playerid] != 1){ SendClientMessage(playerid, COLOR_WHITE, "You are kicked because you didn't joined via application."); Kick(playerid);}
But than, every player that connects has socket_launcher[playerid] = 1; even if he isn't connected via application. Help.
edit: Will I do it with IP check? I send IP of user that connects to samp server, i check is it the same I connected IG and than if it is equal i will let him play, otherwise i will kick him?