16.12.2011, 20:43
Hello, Well I decided to make a script for car radios, so players will be able to hear the streamed music if they are inside of a car. I made a dialog and added stations, but one more thing I want todo is to make it so that only a driver will be able to use/see the dialog and the passengers will be able only to hear the station that the driver had chosen. I know I need to create a viriable somehow, But I never did that before, so I have no idea how, can someone help me with it?
Here is the code that maybe needed
Here is the code that maybe needed
Код:
if(GetPlayerState(playerid)== PLAYER_STATE_DRIVER) { if(strcmp(cmdtext, "/tests", true) == 0) { ShowPlayerDialog(playerid,33,DIALOG_STYLE_LIST,"Music:","\n1.Radio 1\n2.Radio 2\n3.Radio 3\n4.Radio 4","Buy","Cancel"); } } else { if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { SendClientMessage(playerid,YELLOW,"You are not in a car"); } return 1; }